diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3cd67154..00000000 --- a/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -tmp/* -[Cc]onfig/core.php -[Cc]onfig/database.php -app/tmp/* -app/[Cc]onfig/core.php -app/[Cc]onfig/database.php -!empty -.idea -/nbproject/private/private.properties -/nbproject/project.properties -/nbproject/project.xml -/nbproject/private/ \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..ecbc0593 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This 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. \ No newline at end of file diff --git a/README.md b/README.md index 564e3bdd..118c56e1 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,76 @@ === Mailjet Email Newsletter Marketing === -Contributors: mailjet +Contributors: Mailjet Tags: email, marketing, signup, newsletter, widget, smtp, mailjet Requires at least: 3.3.0 -Tested up to: 4.9 -Stable tag: 4.3.0 +Tested up to: 5.0.3 +Stable tag: 5.0.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -Use Mailjet to create, send and track beautiful and engaging marketing and transactional emails directly from within your WordPress admin. +Use Mailjet to create, send and track beautiful and engaging marketing and transactional emails directly from within your WordPress admin. == What's new == -* The plugin features a redesigned subscription confirmation email template -* Now it is possible to use filters to customize the texts inside the subscription confirmation email or replace it with your own template file. +* The all new V5 Mailjet plugin for Wordpress has been completely redesigned and includes many new features. +* Improved plugin settings for simplified configuration +* Redesigned subscription widget for easier setup and more options - mandatory, optional or hidden form fields, custom subscription confirmation page, and more. +* Integration with WooCommerce is included - customers can subscribe to your newsletter during checkout. More integrations are coming soon. +* More flexibility - use filters to set your own subscription confirmation email template or texts inside the email, set your own thank you page, or widget form. == Description == Mailjet's official plugin on WordPress gives you access to: -* Easy Email Management: -Create and manage all of your marketing and transactional email campaigns directly from your WordPress Admin. +* Easy Email Management: +Create and manage all of your marketing and transactional email campaigns directly from your WordPress admin. -* Sign Up Form & Contact Lists Management: +* Sign Up Form & Contact Lists Management: Create and customize contact form widgets to allow your website visitors to subscribe to your newsletters. -* Automated Contact Synchronization: -Automatically synchronize your WordPress contacts into their own separate Mailjet email lists. The user role is added to Mailjet as a contact property, so you can filter and target marketing emails to the proper group. Comment authors can be added to a selected Mailjet contact list too as a second channel for collection of subscribers. With ongoing synchronization, you never have to think about contact management again. +* Automated Contact Synchronization - 3 ways to build your contact lists: -* Campaign Builder Tool: +Synchronize your WordPress contacts. The user role is added to Mailjet as a contact property, so you can filter and target marketing emails to the proper group. With ongoing synchronization, you never have to think about contact management again. + +Comment authors can be added to a separate Mailjet contact list as they choose to subscribe while posting a comment on the blog. + +A new cool option is to subscribe WooCommerce customers to your newsletter during checkout. Just enable the WooCommerce integration inside the plugin and you are ready to go. + +* Campaign Builder Tool: Use our drag and drop email editor or HTML builder to create beautiful and engaging emails - directly from your WordPress admin. -* World Class Deliverability: +* World Class Deliverability: Hit your subscribers' inboxes every time with our global deliverability and routing infrastructure -* Insight and analytics: -Access real-time statistics on your campaigns showing opens, clicks, geographies, average time to click and more to optimize your email performance. +* Insight and analytics: +Access real-time statistics on your campaigns showing opens, clicks, geographies, average time to click and more to optimize your email performance. -* Data Compliance: -Mailjet is GDPR compliant and ISO 27001 certified, meaning that it guarantees an optimal level of email data privacy and security. +* Data Compliance: +Mailjet is GDPR compliant and ISO 27001 certified, meaning that it guarantees an optimal level of email data privacy and security. -* International UI and Support: -Mailjet offers user interfaces, documentation and 24/7 customer support in 4 languages (English, Spanish, French and German). +* International UI and Support: +Mailjet offers user interfaces, documentation and 24/7 customer support in 5 languages (English, French, German, Spanish and Italian). == Installation == - + 1. Log in as administrator in Wordpress. -2. Go to Extensions > Add and send `mailjet-for-wordpress.zip`. -3. Activate the Mailjet extension through the 'Plugins' menu in WordPress. +2. Go to Plugins > Add New +3. Find "Mailjet Email Marketing" in the plugins directory and install it +- or - +Click "Upload plugin" and upload the `mailjet-for-wordpress.zip` file from GitHub +4. Activate the Mailjet extension through the "Plugins" menu in WordPress. -You must have cURL extension enabled. PHP 5.3 or later version is required. +You must have cURL extension enabled. PHP 5.6 or later version is required. ## Frequently Asked Questions = What is Mailjet? = -[Mailjet](http://www.mailjet.com?aff=wordpressmj) is an all-in-one solution to send, track and deliver both marketing and transactional emails. Its cloud-based infrastructure is unique and highly scalable with a proprietary technology that optimizes email deliverability. Mailjet can be accessed either via an easy-to-use online drag-and-drop interface or via APIs that allow developers to integrate its features within their online app or service, or its sophisticated SMTP relay. +[Mailjet](http://www.mailjet.com?aff=wordpressmj) is an all-in-one solution to send, track and deliver both marketing and transactional emails. Its cloud-based infrastructure is unique and highly scalable with a proprietary technology that optimizes email deliverability. Mailjet can be accessed either via an easy-to-use online drag-and-drop interface or via APIs that allow developers to integrate its features within their online app or service, or its sophisticated SMTP relay. -= Why use Mailjet on Wordpress? = += Why use Mailjet on WordPress? = Because you don't have time to build a global leading email infrastructure and have a product or service to build and grow Because you want to compose responsive Newsletters that engage your users and boost your traffic or revenue without having to code Because you want the latest in email tracking technology that shows you which users open and click on your newsletters, when, on what device, on which links, etc. -Because you want to contact a Support Helpdesk that works when you do whether you're a morning person or a night owl. +Because you want to contact a Support Helpdesk that works when you do whether you're a morning person or a night owl. Because you want to easily subscribe new users to your contact lists and not have to worry about keeping them in sync Because you want to make sure your emails get delivered to the inbox! @@ -67,324 +78,127 @@ Because you want to make sure your emails get delivered to the inbox! Yes. You can [create one for free](https://app.mailjet.com/signup?aff=wordpressmj): it's easy and it only takes a few minutes. = How to get started with this plugin? = -Once you have a Mailjet account, an installation Wizard will guide you through. You want to use Mailjet as an SMTP relay, so you will need to change these parameters in your Wordpress email configuration: username and password. These credentials are provided in your 'My Account > API Keys' section [HERE](https://app.mailjet.com/account/api_keys). -For more help on setting up the Mailjet Plugin for WordPress, feel free to check out our [dedicated WordPress User Guide](https://www.mailjet.com/guides/wordpress-user-guide?aff=wordpressmj). +Once you have a Mailjet account, an installation Wizard will guide you through. +In case you want to use Mailjet as an SMTP relay you will need to change these parameters in your WordPress email configuration: username and password. These credentials are provided in your Mailjet Account > API Keys section [HERE](https://app.mailjet.com/account/api_keys). +For more help on setting up the Mailjet Plugin for WordPress, feel free to check out our [dedicated WordPress User Guide](https://www.mailjet.com/guides/wordpress-user-guide?aff=wordpressmj). = How do I create a signup form or use the contact widget? = -Once your Mailjet plugin is installed, click on "Appearance" in the left-side menu and then choose the "Widgets" section. Just drag the "Subscribe to Our Newsletter" widget and drop it where you want it to appear (i.e. the sidebar). For more precisions, please visit the official help page [Adding Widgets](http://en.support.wordpress.com/widgets/#adding-widgets). +Once your Mailjet plugin is installed and configured, click on "Appearance" in the left-side WordPress admin menu and then choose the "Widgets" section. Just drag the "Mailjet Subscription Widget" widget and drop it where you want it to appear (i.e. the sidebar). For more details, please visit the official help page [Adding Widgets](http://en.support.wordpress.com/widgets/#adding-widgets). -= How do I synchronize my contact lists? = -Synchronization is automatic, that's the beauty of this plugin! It doesn't matter whether your lists were uploaded on your WordPress interface or on your Mailjet account: they will always remain up-to-date on both sides. += How do I synchronize my contact lists? = +Synchronization is automatic, that's the beauty of this plugin! It doesn't matter whether your lists were updated on your WordPress interface or on your Mailjet account: they will always remain up-to-date on both sides. = In which languages is this plugin available? = -The Mailjet Plugin is available in English, Spanish, French and German. -Need help? Our multilingual support team is here to answer your questions in any of these languages, any day of the week, at any time via our [online helpdesk](https://www.mailjet.com/support). +The Mailjet Plugin is available in English, Spanish, French, German and Italian. +Need help? Our multilingual support team is here to answer your questions in any of these languages, any day of the week, at any time via our [online helpdesk](https://app.mailjet.com/support). = How to use filters to customize the subscription confirmation email template = Add the following code to your template functions.php file. Uncomment the messages that you would like to replace.

+/**
+ * Override subscription confirmation email texts
+ * @param array $emailData -default Mailjet email template parameters
+ * @return string
+ */
+
+function updateMailjetSubscriptionEmailParameters($emailData) {
 add_filter( 'mailjet_subscription_widget_email_params', 'updateMailjetSubscriptionEmailParameters' );
-function example_callback($emailData) {
+
+    // Some custom parameters used from custom template added via `mailjet_confirmation_email_filename`
+    // $emailData['TITLE'] = 'Custom title';
+    // $emailData['SOME_HEADER'] = 'Custom header';
+    // $emailData['CONFIRM'] = 'Custom confirm';
+    // $emailData['SOME_FOOTER'] = 'Custom footer';
+
+    // Override default mailjet parameters
     // $emailData['__EMAIL_TITLE__'] = 'Please confirm your subscription';
     // $emailData['__EMAIL_HEADER__'] = 'To receive newsletters from __WP_URL__ please confirm your subscription by clicking the following button:';
     // $emailData['__CLICK_HERE__'] = 'Yes, subscribe me to this list';
     // $emailData['__COPY_PASTE_LINK__'] = 'You may copy/paste this link into your browser:';
-    // $emailData['__IGNORE__'] = 'If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message.';
+    // $emailData['__IGNORE__'] = 'If you received this email by mistake or don\'t wish to subscribe anymore, simply ignore this message.';
     // $emailData['__THANKS__'] = 'Thanks,';
     // $emailData['__FROM_NAME__'] = 'The Mailjet Team';
     return $emailData;
-}
+} + + += How to use filters to replace the email confirmation template with my own file = +You need to have a php file with your custom template uploaded to your WordPress server. Then add the following code to your template functions.php file. +

+/**
+ * Replace default Mailjet template path with a your own
+ * @param string $templatePath - the path of the default mailjet template
+ * @return string
+ */
+
+add_filter( 'mailjet_confirmation_email_filename', 'useCustomConfirmationEmail' );
+function useCustomConfirmationEmail($templatePath) {
+    return './custom_subscription_path.php';
+}
+
-= How to replace the email confirmation template with my own file = += How to use filters to set your own Thank You page = You need to have a php file with your custom template uploaded to your WordPress server. Then add the following code to your template functions.php file.

-add_filter( 'mailjet_confirmation_email_filename', 'getMailjetSubscriptionEmailTemplate' );
-function getMailjetSubscriptionEmailTemplate($templatePath) {
+/**
+ * Replace default Mailjet Thank You page template path with a your own
+ * @param string $templatePath - the path of the default Mailjet Thank You page template
+ * @return string
+ */
+
+add_filter( 'mailjet_thank_you_page_template', 'updateThankYouPagePath' );
+function updateThankYouPagePath($templatePath) {
+    return './custom_thank_you_page_path.php';
+}
+
- return /path/to/my-template.php; += How to use filters to replace the widget form file = +You need to have a php file with your custom template uploaded to your WordPress server. Then add the following code to your template functions.php file. +

+/**
+ * Replace default Mailjet widget form file with your own
+ * @param string $templatePath - the path of the default Mailjet widget form file
+ * @return string
+ */
+
+add_filter( 'mailjet_widget_form_filename', 'useMailjetCustomWidgetFormTemplate' );
+function useMailjetCustomWidgetFormTemplate($templatePath) {
+    return './custom_mailjet_widget_template.php';
 }
 
+= For developers - before pushing any new changes, make sure you run the following command. It will remove unneeded .git direcotries from vendors = +

+find vendor/ -type d -name ".git" -exec rm -rf {} \;
+
+ == Screenshots == -1. Simply change a few parameters to get started. -2. Manage your lists and contacts in no time! +1. The initial setup wizard will guide you through the quick steps to get started +2. Access all features from the plugin dashboard 3. Create and send beautiful email campaigns -4. Get instant insight on your campaign's performance with detailed statistics +4. Configure a subscription widget to collect subscribers from your site == Changelog == -= 4.3.0 = -* Update the confirmation email template for English, French, German and Spanish -* Add new filter 'mailjet_subscription_widget_email_params' that enable the users to replace the email confirmation message parameters -* Add new filter 'mailjet_confirmation_email_filename' that enable the users to replace the email confirmation template -* Add new field 'From name' in Mailjet General Settings -* Add event delegation that allow widget to work if it is loaded via AJAX - -= 4.2.16 = -* Update the confirmation email template -* Add new filter 'mailjet_subscription_widget_email_params' that enable the users to replace the email confirmation message parameters -* Add new filter 'mailjet_confirmation_email_filename' that enable the users to replace the email confirmation template -* Add new field 'From name' in Mailjet General Settings -* Add event delegation that allow widget to work if it is loaded via AJAX - -= 4.2.15 = -* Remove changing plugins locale globally - -= 4.2.14 = -* Update tracking parameter - -= 4.2.13 = -* Added support for de_DE_formal locale - -= 4.2.12 = -* Translation update - -= 4.2.11 = -* Updated 'Tested up to' version to include WordPress 4.9 - -= 4.2.10 = -* Translations update - -= 4.2.9 = -* Fix strtotime() function when format is dd/mm/YYYY - -= 4.2.8 = -* Added conversion to timestamp for date time contact properties before send them to the API - -= 4.2.7 = -* Subscription widget added validation for contact properties of date type - -= 4.2.6 = -* Added new translations - -= 4.2.5 = -* Replace site_url with home_url for subscription confirmation links - -= 4.2.4 = -* Fix widget subscription issue - -= 4.2.3 = -* Replace short array definition usage with long one for backward compatibility - -= 4.2.2 = -* Rename some function to avoid conflict with 3rd party ones - -= 4.2.1 = -* Updated widget connection over SSL - -= 4.2.0 = -* Added Initial Wordpress user synchronization to Mailjet -* Added Wordpress user role as a contact property and synced to Mailjet -* Changes on Mailjet plugin configuration page - -= 4.1.19 = -* Updated text description, icon, screenshots and style - -= 4.1.18 = -* Updated text description, icon, screenshots and style - -= 4.1.17 = -* Updated Readme file - -= 4.1.16 = -* Updated Readme file - -= 4.1.15 = -* Updated screenshots -* Updated header image -* Updated Readme file - -= 4.1.14 = -* Widget - disabled rewrite of subscription confirmation link - -= 4.1.13 = -* Slight visual modifications - changed iframe left margin and width - -= 4.1.12 = -* Updated 'Tested up to' version to include WordPress 4.7 - -= 4.1.11 = -* Updating widget CSS for better displaying on lower resolutions - -= 4.1.10 = -* Add the link to the user guide & Support Ticket -* UX change in settings page - -= 4.1.9 = -* Widget - css fix - -= 4.1.8 = -* Improvement in Subscription widget - Adding an additional link - -= 4.1.7 = -* Fix with additional fields on registration form - -= 4.1.6 = -* System message update - -= 4.1.5 = -* API call improvements - -= 4.1.4 = -* Replaced jQuery .live() with .on() -* CSS conflict with a specific 3rd party plugin fix -* auto-subscribe improvement -* Updated 'Tested up to' version to include WordPress 4.4.1 - -= 4.1.3 = -* Widget - meta property fix -* Widget - on subscription, the code will check for valid input data types -* Widget - the input contact meta properties now appear correctly in the front end when the site is in language other than the 4 languages supported (EN, FR, DE, ES) - -= 4.1.2 = -* Translations fixes -* Subscribe to contacts list with different scenarios - fix - -= 4.1.1 = -* JavaScript fixes of the widget -* CSS fixes for jquery accordion ui plugin - -= 4.1.0 = -* Subscription widget - added multilanguage support - EN, FR, ES, DE -* Display issue fix - -= 4.0.1 = -* Updated 'Tested up to' version to include WordPress 4.4 - -= 4.0.0 = -* Subscription widget for v3 users can now include contact meta properties from the client e.g. first name, last name, age, location, industry etc, allowing up to 3 properties. - -= 3.2.4 = -* Fixed sign up link translations - -= 3.2.2 = -* Added new iFrame param - sp=display - to display sending policy block - -= 3.2.1 = -* Removed Reply-To header when using PHPMailer - -= 3.1.21 = -* Readme file update - -= 3.1.20 = -* Added USER AGENT tracking on every curl request - -= 3.1.19 = -* Widget button translation fix - -= 3.1.18 = -* Servers with PHP version 5.3 would be able to check if headers for ReplyTo already exist and add the Mailjet headers only if no ReplyTo headers are set. - -= 3.1.17= -* When we create a TOKEN we also send SentData containing plugin name - -= 3.1.16= -* Translation of the iframe and also some small corrections are executed for the translations from i18n folder; - -= 3.1.15= -* All strings are translated in german, french and spanish. - -= 3.1.14= -* Changed checking for correct sender. - -= 3.1.13= -* Modification of how to detect v1 and v3 users. - -= 3.1.12= -* Part of the translations are translated. - -= 3.1.11= -* We display more human readable messages for those cases when we enter wrong API/Secret Key and also our "from email" does not match with any of the sender part of our Mailjet's account - -= 3.1.10= -* Rename function my_save_extra_profile_fields to mailjet_my_save_extra_profile_fields - -= 3.1.9= -* Bug fix related to the compatibility of the plugin for v1 and v3 users - -= 3.1.8= -* Stop scripts from being output unnecessarily when we load the widget on the front-end. - -= 3.1.7= -* The user can set the port from the settings page. - -= 3.1.6= -* The administrator of the website is able to give access to the plugin for other user roles. - -= 3.1.5= -* MJ_HOST and MJ_MAILER variables are moved to the api strategy patter class as public properties of the class. From now on, they are -accessible from there. - -= 3.1.4= -* Add a confirmation message when an user activates his/her contact widget on his/her Wordpress admin -* In the admin panel of WordPress, when a user try to add a "subscribe to our newsletter widget" we have add a validation if he/she has chosen a contact list - -= 3.1.3= -* The position of the main Mailjet's menu takes a default value instead of value 101 -* Removed AKID from APIv3 calls from the plugin -* Prevent plugin from hiding other plugin's page #10 -* README update - -= 3.1.2 = -* Updated readme - -= 3.1.1 = -* Tag bug fix for V1 & V3 compatible plugin - -= 3.1.0 = -* Supports V1 and V3 Mailjet's users, Add use tracking on the WordPress plugin, Fix IsActive parameter for token creation - -= 3.0.3 = -* Add tracking of signups on the WordPress plugin, Fix IsActive parameter for token creation - -= 3.0.2 = -* Fix MailJet host - -= 3.0.1 = -* Bug fix on connecting contact to a list - -= 3.0.0 = -* The plugin is switched to v3 mailjet's users, and also the communication with mailjet is mainly executed with iframes - -= 1.2.8 = -* Added cURL warning and missing translations - -= 1.2.7 = -* Bug fix on ssl option and widget constructor, code cleaning - -= 1.2.6 = -* Bug fix - -= 1.2.5 = -* Add ability to autosubscribe newly registered users to a specific list - -= 1.2.3 = -* Add ports 80 and 588 to work around some hosts limitations - -= 1.2.2 = -* Added Ability to change widget button text - -= 1.2.1 = -* Added campaigns and statistics management += 5.0.6 = +* Allow logged in WooCommerce customers to subscribe to the newsletter during checkout. +* Fixed css issues in the WP admin +* Small bugfixes and improvements -= 1.1.5 = -* Added: HTTP Port Configuration -= 1.1.3 = -* Bugfix: Correct ajax request for WordPress 3.2.1 -* Bugfix: Correct widget creation += 5.0.5 = +* Fix subscription widget issues for multilanguage sites +* Fix fatal error for WooCommerce integration -= 1.1.1 = -* added readme and translations files += 5.0.4 = +* Fix widget contact properties to be compatible with polylang -= 1.1 = -* Bug fix: compatibility with WordPress 3.4 -* Add support for list edition and creation -* Add signup form to list in native WordPress widget += 5.0.3 = +* Fix fatal error for php 5.5 -= 1.0.1 = -* Bug fix on install. += 5.0.2 = +* Fix small bugfixes -= 1.0= -* First stable release. += 5.0.1 = +* Plugin redesign and major improvements diff --git a/api/index.html b/api/index.html deleted file mode 100644 index 3af63015..00000000 --- a/api/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/api/mailjet-api-v1.php b/api/mailjet-api-v1.php deleted file mode 100644 index 75b9c10f..00000000 --- a/api/mailjet-api-v1.php +++ /dev/null @@ -1,227 +0,0 @@ -apiKey = $apiKey; - if ($secretKey) - $this->secretKey = $secretKey; - - $this->apiUrl = (($this->secure) ? 'https' : 'http') . '://api.mailjet.com/' . $this->version . ''; - } - - public function __call($method, $args) - { - // params - $params = (sizeof($args) > 0) ? $args[0] : array(); - - // request method - $request = isset($params["method"]) ? strtoupper($params["method"]) : 'GET'; - - // unset useless params - if (isset($params["method"])) - unset($params["method"]); - - // Make request - $result = $this->sendRequest($method, $params, $request); - - // Return result - $return = ($result === true) ? $this->_response : false; - - if ($this->debug == 2 || ( $this->debug == 1 && $return == false)) - $this->debug(); - - return $return; - } - - public function requestUrlBuilder($method,$params=array(),$request) - { - $query_string = array('output' => 'output=' . $this->output); - - foreach ($params as $key => $value) - { - if ($request == 'GET' || in_array($key, array('apikey', 'output'))) - $query_string[$key] = $key . '=' . urlencode($value); - if ($key == 'output') - $this->output = $value; - } - - $this->call_url = $this->apiUrl . '/' . $method . '/?' . join('&', $query_string); - - return $this->call_url; - } - - public function sendRequest($method = false, $params = array(), $request = 'GET') - { - // Method - $this->_method = $method; - $this->_request = $request; - - // Build request URL - $url = $this->requestUrlBuilder($method, $params, $request); - - if (!in_array('curl', get_loaded_extensions())) - die('Error: You must have cURL extension enabled !'); - - // Set up and execute the curl process - $curl_handle = curl_init(); - curl_setopt($curl_handle, CURLOPT_URL, $url); - curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($curl_handle, CURLOPT_USERPWD, $this->apiKey . ':' . $this->secretKey); - curl_setopt($curl_handle, CURLOPT_VERBOSE, true); - curl_setopt($curl_handle, CURLINFO_HEADER_OUT, true); - curl_setopt($curl_handle, CURLOPT_USERAGENT, 'wordpress-v1.4.3.0'); - - $this->_request_post = false; - if ($request == 'POST') - { - curl_setopt($curl_handle, CURLOPT_POST, count($params)); - curl_setopt($curl_handle, CURLOPT_POSTFIELDS, http_build_query($params)); - $this->_request_post = $params; - } - - $buffer = curl_exec($curl_handle); - - if ($this->debug > 2) - { - $this->debug(); - var_dump($buffer); - var_dump(curl_getinfo($curl_handle)); - } - - // Response code - $this->_response_code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE); - - // Close curl process - curl_close($curl_handle); - - // RESPONSE - $this->_response = ($this->output == 'json') ? json_decode($buffer) : $buffer; - - return ($this->_response_code == 200) ? true : false; - } - - public function debug() - { - echo ''; - - echo '
'; - - if (isset($this->_response_code)) - { - if ($this->_response_code == 200) - { - echo ''; - echo ''; - echo ''; - - if (isset($this->_response)) - echo ''; - - echo '
Success
Status code' . $this->_response_code . '
Response
' . utf8_decode(print_r($this->_response, 1)) . '
'; - } - elseif($this->_response_code == 304) - { - echo ''; - echo ''; - echo ''; - echo ''; - echo '
Error
Error no' . $this->_response_code . '
MessageNot Modified
'; - } - else - { - echo ''; - echo ''; - echo ''; - - if (isset($this->_response)) - { - if (is_array($this->_response) || is_object($this->_response)) - echo ''; - else - echo ''; - } - } - echo '
Error
Error no' . $this->_response_code . '
Status
' . print_r($this->_response, true) . '
Status
' . $this->_response . '
'; - } - - $call_url = parse_url($this->call_url); - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo '
API config
Protocole' . $call_url['scheme'] . '
Host' . $call_url['host'] . '
Version' . $this->version . '
'; - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - if ($this->_request_post) - { - echo ''; - } - - echo ''; - echo '
Call infos
Method' . $this->_method . '
Request type' . $this->_request . '
Get Arguments'; - - $args = explode("&", $call_url['query']); - foreach ($args as $arg) - { - $arg = explode('=', $arg); - echo ''.$arg[0].' = ' . $arg[1] . '
'; - } - - echo '
Post Arguments'; - - foreach ($this->_request_post as $k => $v) - echo $k.' = ' . $v . '
'; - - echo '
Call url' . $this->call_url . '
'; - echo '
'; - } -} diff --git a/api/mailjet-api-v3.php b/api/mailjet-api-v3.php deleted file mode 100644 index b7019559..00000000 --- a/api/mailjet-api-v3.php +++ /dev/null @@ -1,919 +0,0 @@ -_apiKey = $apiKey; - if (isset($secretKey)) - $this->_secretKey = $secretKey; - $this->_apiUrl = 'http://'.$this->_apiUrl.$this->_version.'/'; - $this->secure($secure); - - $this->_log_allowed = get_cfg_var('MAILJET_ENVIRONMENT') == 'dev'; - - $this->_fixLogPath(); - } - - /** - * Singleton pattern : - * Get the instance of the object if it already exists - * or create a new one. - * - * @access public - * @uses MailjetApi::$_instance - */ - public static function getInstance() - { - if (!(self::$_instance instanceof self)) - self::$_instance = new self(); - - return self::$_instance; - } - - /** - * Destructor - * - * Close the cURL handle resource - * - * @access public - * @uses MailjetApi::$_curl_handle - */ - public function __destruct() - { - if(!is_null($this->_curl_handle)) - curl_close($this->_curl_handle); - $this->_curl_handle = NULL; - } - - /** - * Set new Api Key and Secret Key - * - * @access public - * @uses MailjetApi::$_apiKey - * @uses MailjetApi::$_secretKey - * @param string $apiKey Mailjet API Key - * @param string $secretKey Mailjet API Secret Key - */ - public function setKeys($apiKey, $secretKey) - { - $this->_apiKey = $apiKey; - $this->_secretKey = $secretKey; - } - - /** - * Set the seconds before updating the cache object - * If set to 0, Object caching will be disabled - * - * @access public - * @uses MailjetApi::$_cache - * @param integer $cache Cache to set in seconds - */ - public function setCache($cache) - { - $this->_cache = $cache; - } - - /** - * Get the seconds before updating the cache object - * If set to 0, Object caching will be disabled - * - * @access public - * @uses MailjetApi::$_cache - * - * @return integer Cache in seconds - */ - public function getCache() - { - return ($this->_cache); - } - - /** - * - * @param Boolean $flag - * @return mailjetapi - */ - public function setLog($flag) - { - $this->_log = (boolean) $flag; - return $this; - } - - /** - * - * @return boolean - */ - public function getLog() - { - return $this->_log; - } - - /** - * - * @param Boolean $flag - * @return mailjetapi - */ - public function setLogOnce($flag) - { - $this->_log_once = (boolean) $flag; - return $this; - } - - /** - * - * @return boolean - */ - public function getLogOnce() - { - return $this->_log_once; - } - - /** - * - * @return string - */ - public function getVersion() - { - return $this->_version; - } - - /** - * - * @param Boolean $flag - * @return mailjetapi - */ - public function setExtraError($flag) - { - $this->_extra_err = (boolean) $flag; - return $this; - } - - /** - * - * @return boolean - */ - public function getExtraError() - { - return $this->_extra_err; - } - - /** - * Enable log only if MAILJET_ENVIRONMENT == 'dev' - * @return boolean - */ - public function logAllowed() - { - return $this->_log_allowed; - } - - /** - * - * @param String $path - * @return mailjetapi - */ - public function setLogPath($path) - { - if ($real_path = realpath($path)) { - $this->_log_path = $real_path; - } - return $this; - } - - /** - * - * @return String - */ - public function getLogPath() - { - return $this->_log_path; - } - - /** - * - * @return mailjetapi - */ - protected function _fixLogPath() - { - //fix log path - if(!defined('SYSTEMPATH')) define('SYSTEMPATH', dirname(__FILE__).'/../'); - $this->_log_path = realpath(SYSTEMPATH.$this->_log_path); - $logFilename = 'daily-'.date('Ymd').'.log'; - $this->_log_path = str_replace('current.log', $logFilename, $this->_log_path); - return $this; - } - - /** - * Secure or not the transaction through https - * - * @access public - * @uses MailjetApi::$_apiUrl - * @param boolean $secure TRUE to secure the transaction, FALSE otherwise - */ - public function secure($secure = TRUE) - { - $protocol = 'http'; - if ($secure) - $protocol = 'https'; - $this->_apiUrl = preg_replace('/http(s)?:\/\//', $protocol.'://', $this->_apiUrl); - } - - /** - * Make the magic call ;) - * - * Check for some arguments and order them before sending the request. - * If '_debug_info' is found, some data are stored and can be retrieved - * with a call to MailjetApi::getDebugInfo(). - * - * @access public - * @uses MailjetApi::$_debug - * @uses MailjetApi::$_debug_info - * @uses MailjetApi::sendRequest() to send the request - * @param string $object Method to call - * @param array $args Array of parameters - * - * @return string JSON string by default (format can be change with the 'format' parameter) - */ - public function __call($object, $args) - { - if (sizeof($args) > 0) - $params = $args[0]; - else - $params = array(); - - if (isset($params['method'])) { - $method = strtoupper($params['method']); - unset($params['method']); - } - if (!isset($method) || !in_array($method, array('GET', 'POST', 'PUT', 'DELETE', 'JSON'))) - $method = 'GET'; - - if (isset($params['debug_info'])) { - $this->_debug = TRUE; - $this->_debug_info = $params['debug_info']; - unset($params['debug_info']); - } - - /** - * Logging - */ - if (isset($params['log'])) { - $this->setLog($params['log']); - unset($params['log']); - } - - if (isset($params['log_once'])) { - $this->setLogOnce($params['log_once']); - unset($params['log_once']); - } - - if (isset($params['log_path'])) { - $this->setLogPath($params['log_path']); - unset($params['log_path']); - } - - // Extra Error - if (isset($params['extra_err'])) { - $this->setExtraError($params['extra_err']); - unset($params['extra_err']); - } - - /** - * Fallback logging when debug is true - */ - if ($this->_debug) { - $this->setLogOnce(true); - } - - return (json_decode($this->sendRequest($object, $params, $method))); - } - - /** - * Send Request - * - * Send the request to the Mailjet API server and get back the result - * Basically, setup and execute the curl process. - * Cache management added - * - * @access private - * @uses MailjetApi::$_info - * @uses MailjetApi::$_debug - * @uses MailjetApi::$_buffer - * @uses MailjetApi::$_method - * @uses MailjetApi::$_apiKey - * @uses MailjetApi::$_secretKey - * @uses MailjetApi::$_curl_handle - * @uses MailjetApi::buildURL() to build the full Url for the request and update the list of parameters accordingly - * @param string $object Object or collection of resources you want to access - * @param array $params Additional parameters for the request - * @param string $method POST: Create a resource - * GET: Read one or multiple resources - * PUT: Update one or multiple resources - * DELETE: Delete one or multiple resources - * - * @return string the result of the request - */ - private function sendRequest($object, $params, $method) - { - - // Log if this is a JSON call with an ID inside params - $is_json_put = (isset($params['ID']) && !empty($params['ID'])); - - list($url, $params) = $this->buildURL($object, $params, $method); - - if ($this->_cache != 0 && $method == 'GET' && !$this->_akid) { - $file = $method.'.'.$object.'.'.hash('md5', $this->_apiKey.http_build_query($params, '', '')).'.cache'; - } - - if(is_null($this->_curl_handle)) - $this->_curl_handle = curl_init(); - - curl_setopt($this->_curl_handle, CURLOPT_URL, $url); - curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($this->_curl_handle, CURLOPT_USERPWD, $this->_apiKey.':'.$this->_secretKey); - curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($this->_curl_handle, CURLOPT_USERAGENT, 'wordpress-4.3.0'); - - switch ($method) { - case 'GET' : - curl_setopt($this->_curl_handle, CURLOPT_HTTPGET, TRUE); - curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, NULL); - break; - - case 'POST': - if(isset($params['Action']) && $params['Action']=='Add'){ - curl_setopt($this->_curl_handle, CURLOPT_POST, count($params)); - curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, json_encode($params)); - curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); - } - else{ - curl_setopt($this->_curl_handle, CURLOPT_POST, count($params)); - curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, $this->curl_build_query($params)); - } - break; - - case 'PUT': - curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, $this->curl_build_query($params)); - break; - - case 'JSON': - if($is_json_put) - curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, "PUT"); - else - curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, "POST"); - - $params = json_encode($params); - curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, $params); - curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, TRUE); - curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array( - 'Content-Type: application/json', - 'Content-Length: ' . strlen($params)) - ); - break; - - } - - $buffer = curl_exec($this->_curl_handle); - - $this->_info = curl_getinfo($this->_curl_handle); - $this->_response_code = $this->_info['http_code']; - - curl_close($this->_curl_handle); - $this->_curl_handle = null; - - if ($this->_debug) { - $this->_buffer = $buffer; - $this->_method = $method; - $this->_debug = FALSE; - } - - if ($this->_cache != 0 && $method == 'GET' && !$this->_akid) { - $data = array('timestamp' => time(), 'result' => $buffer, 'http_code' => $this->_info['http_code']); - } - - if( $this->getExtraError() ){ - $this->getExtraErr( $buffer ); - $this->setExtraError( false ); - } - - if ($this->logAllowed() && ($this->getLog() || $this->getLogOnce())) { - - if ($this->_info) { - $moreInfo = print_r(array( - 'content_type' => $this->_info['content_type'], - 'http_code' => $this->_info['http_code'], - 'total_time' => $this->_info['total_time'], - ), true); - $moreInfo = substr($moreInfo, 6); - } else { - $moreInfo = 'none'; - } - - $date = DateTime::createFromFormat('U.u', microtime(true)); - - if (is_array($params)) { - $jsonParams = json_encode($params); - } else { - $jsonParams = $params; - } - - $logLines = array(); - - $logLines[] = ''; - $logLines[] = $date->format('Y-m-d H:i:s.u')." > {$object} :: {$method}"; - $logLines[] = ''; - $logLines[] = $this->_info['url']; - $logLines[] = ''; - $logLines[] = "Request"; - $logLines[] = $jsonParams; - $logLines[] = ''; - $logLines[] = "Response"; - $logLines[] = $buffer; - $logLines[] = ''; - $logLines[] = 'Info'; - $logLines[] = $moreInfo; - $logLines[] = ''; - $logLines[] = str_repeat("=", 100); - $logLines[] = ''; - - $logText = implode(PHP_EOL, $logLines); - - file_put_contents($this->getLogPath(), $logText, FILE_APPEND); - - $this->setLogOnce(false); - - } - - return $buffer; - } - - /** - * Build the full Url for the request and update the parameters if needed - * - * @access private - * @uses MailjetApi::$_apiUrl - * @param string $object Object or collection of resources you want to access - * @param array $params Additional parameters for the request - * @param string $method POST: Create a resource - * GET: Read one or multiple resources - * PUT: Update one or multiple resources - * DELETE: Delete one or multiple resources - * - * @return array Full built Url for the request and new params - */ - private function buildURL($object, $params, $method = 'GET') - { - $url = $this->_apiUrl.$object; - - if (isset($params['ID'])) { - $url .= '/'.$params['ID']; - unset($params['ID']); - } - - $this->_akid = array_key_exists('akid', $params); - - if ($method == 'GET') - $url .= '?'.http_build_query($params, '', '&'); - elseif ($method == 'PUT' || $method == 'POST' || $method == 'DELETE' || $method == 'JSON') { - $tocheck = array('format', 'style', 'countrecords', 'recurse', 'akid', 'DuplicateFrom'); - $query = array(); - foreach ($params as $key => $value) - if (in_array($key, $tocheck)) { - $query[$key] = $value; - unset($params[$key]); - } - if(count($query)) - $url .= '?'.http_build_query($query, '', '&'); - - } - - return (array($url, $params)); - } - - /** - * Build query for cURL - * Beware of the Boolean ! - * - * @access private - * @param array $params Post parameters for the request - * - * @return string URL-encoded query string from the associative array provided - */ - private function curl_build_query($params) - { - foreach($params as $key => $value) { - if($value === TRUE) - $value = 'true'; - elseif($value === FALSE) - $value = 'false'; - } - /*array_walk($params, function(&$value, &$key) { - if ($value === TRUE) { - $value = 'true'; - } elseif ($value === FALSE) { - $value = 'false'; - } - });*/ - - return (http_build_query($params, '', '&')); - } - - /** - * Get the last HTTP code retrieved by cURL - * - * Warning : Information returned by this function is kept. - * So, if you call it again, the previous info is returned. - * - * @access public - * @uses MailjetApi::$_info - * - * @return integer last HTTP code retrieved by cURL or 0 if not set - */ - public function getLastHTTPCode() - { - if (isset($this->_info['http_code'])) - return ($this->_info['http_code']); - - return (0); - } - - /** - * Set some info if the object came from the cache - * - * @access private - * @uses MailjetApi::$_info - * @uses MailjetApi::$_buffer - * @uses MailjetApi::$_method - * @uses MailjetApi::$_debug_info - */ - private function setCacheDebugInfo($method, $url, $data) - { - $this->_debug_info .= ' /* LAST CACHED AT '.date('Y/m/d H:i:s', $data['timestamp']).' - UPDATING EVERY '.$this->_cache.'s */'; - $this->_buffer = $data['result']; - $this->_method = $method; - $this->_info = array(); - $this->_info['url'] = $url; - $this->_info['http_code'] = $data['http_code']; - $this->_info['total_time'] = $this->_info['pretransfer_time'] = 0; - $this->_debug = FALSE; - } - - /** - * Get some info for debugging purpose - * - * Warning : Information returned by this function is kept. - * So, if you call it again, the previous info is returned. - * To update this array, you need to add the key 'debug_info' - * to the list of parameters. You can specified a value to - * identify the returned array. - * - * @access public - * @uses MailjetApi::$_info - * @uses MailjetApi::$_method - * @uses MailjetApi::$_debug_info - * - * @return array with some debug info - */ - public function getDebugInfo() - { - $status_code = array ( - 200 => 'OK - Everything went fine.', - 201 => 'OK - Created : The POST request was successfully executed.', - 204 => 'OK - No Content : The Delete request was successful.', - 304 => 'OK - Not Modified : The PUT request didn’t affect any record.', - 400 => 'KO - Bad Request : Please check the parameters.', - 401 => 'KO - Unauthorized : A problem occurred with the apiKey/secretKey. You may be not authorized to access the API or your apiKey may have expired.', - 403 => 'KO - Forbidden : You are not authorized to call that function.', - 404 => 'KO - Not Found : The resource with the specified ID does not exist.', - 405 => 'KO - Method not allowed : Attempt to put/post multiple resources in 1 request.', - 500 => 'KO - Internal Server Error.', - 503 => 'KO - Service unavailable.' - ); - - if (array_key_exists($this->_info['http_code'], $status_code)) - $http_code_text = $status_code[$this->_info['http_code']]; - else - $http_code_text = 'KO - Service unavailable.'; - - $status_message = ''; - if ($this->_info['http_code'] >= 400) { - $buffer = json_decode($this->_buffer); - if (!is_null($buffer) && isset($buffer->StatusCode) && isset($buffer->ErrorMessage)) { - $status_message = $buffer->StatusCode.' - '.$buffer->ErrorMessage; - if (isset($buffer->ErrorInfo) && !empty($buffer->ErrorInfo)) - $status_message .= ' ('.$buffer->ErrorInfo.')'; - } - } - - $res = array( - 'debug_info' => $this->_debug_info, - 'method' => $this->_method, - 'url' => $this->_info['url'], - 'duration' => $this->_info['total_time'] - $this->_info['pretransfer_time'], - 'http_code' => $this->_info['http_code'], - 'http_code_text'=> $http_code_text, - 'status_message'=> $status_message, - 'curl_info' => $this->_info, - 'buffer' => $this->_buffer - ); - - return $res; - } - - protected function getExtraErr( &$buffer ) - { - $bufferCheck = json_decode($buffer); - - if( is_null( $bufferCheck ) ) - return; - - $buffer = $bufferCheck; - - if( $this->_info['http_code'] < 400 ) - { - $response = array( (object)array( "ExtraErrCode" => $this->_info['http_code'], "ExtraErrKey" => "", "ExtraErrMsg" => "" ) ); - $buffer->ExtraError = $response ; - $buffer = json_encode( $buffer ); - return; - } - - $internalErrors = array( - 'MJ01' => 'Could not determine APIKey', // SERRCouldNotDetermineAPIKey - 'MJ02' => 'No persister object found for class: "%s"', // SErrNoPersister - 'MJ03' => 'A non-empty value is required', // SErrValueRequired - 'MJ04' => 'Value must have at least length %d', // SErrMinLength - 'MJ05' => 'Value may have at most length %d', // SErrMaxLength - 'MJ06' => 'Value must be larger than or equal to %s', // SErrMinValue - 'MJ07' => 'Value must be less than or equal to %s', // SErrMaxValue - 'MJ08' => 'Property %s is invalid: %s', // SErrInProperty - 'MJ09' => 'Value is not in list of allowed values: (%s)', // SErrValueNotInList - 'MJ10' => 'Value must be positive', // SErrPositiveValueRequired - 'MJ11' => 'Unknown object type "%s".', // SErrUnknownObject - 'MJ12' => 'Cannot save object of type %s', // SerrCannotSaveObjectType - 'MJ13' => 'Invalid characters in MD5 hash: "%s"', // SErrInvalidHashCharacters - 'MJ14' => 'Invalid length for MD5 hash: %d', // SErrInvalidHashLength - 'MJ15' => 'Unknown relation name : "%s"', // SErrUnkownRelation - 'MJ16' => 'Class "%s" does not support a unique key.', // SErrNoAlternateKey - 'MJ17' => '(%s) Cannot search unique key: unique key value is empty.', // SErrNoAlternateKeyValue - 'MJ18' => 'A %s resource with value "%s" for %s already exists.', // SErrDuplicateKey - 'MJ19' => 'Setting a value for property "%s" is not allowed', // SErrCannotWriteProperty - 'MJ20' => 'Setting a value for properties is not allowed', // SErrCannotWriteProperties - // ContactMetadata - 'CM01' => 'Property "%s" already exists', // sERRCMPropertyAlreadyExists - 'CM02' => 'Unknown namespace : %s', // SERRCMUnknownNamespace - 'CM03' => '"%s" is not a valid integer value for key %s', // SERRCMNotAValidIntegerValueForKey - 'CM04' => '"%s" is not a valid bool value for key %s', // SERRCMNotAValidBoolValueForKey - 'CM05' => '"%s" is not a valid float value for key %s', // SERRCMNotAValidFloatValue - 'CM06' => 'Length of value (%d bytes) exceeds maximum data length (%d bytes) ', // SERRCMLengthOfValueExceedsMaxDataLength - 'CM07' => 'Internal error: invalid data type %d', // SERRCMInternalErrorInvalidDataType - 'CM08' => '"%s" is not a valid datatype' // SERRCMNotAValidDataType - ); - - $response = array(); - - // We expect here $this->_info['http_code'] to be >= 400 - if ( isset($buffer->StatusCode) ) { - if( ( isset($buffer->ErrorInfo) && !empty($buffer->ErrorInfo) ) || ( isset($buffer->ErrorMessage) && !empty($buffer->ErrorMessage) ) ) - { - $comeFromString = false; - if( !empty( $buffer->ErrorInfo ) ) - { - $info = json_decode( $buffer->ErrorInfo ); - if( empty( $info) ) // message is type=string - { - $comeFromString = true ; - $errInfos = array( (object)$buffer->ErrorInfo ); - }else{ - $errInfos = $info; - } - }else{ // ( !empty( $buffer->ErrorMessage ) ) - $info = json_decode( $buffer->ErrorMessage ); - if( empty( $info ) ) // message is type=string - { - $comeFromString = true ; - $errInfos = array( (object)$buffer->ErrorMessage ); - }else{ - $errInfos = $info; - } - } - /** - * Default response. Most of the ErrorInfo/ErrorMessage will come as they are - without specific err code in front! - * We keep the ExtraErrors = ErrorInfo/ErrorMessage. - * - * In the feature all the responses will consist these special codes. - * When this happen (!!! ToDo !!!) -> we have to override coming StatusCode and ErrorInfo with parsed error results. And remove this ExtraError from the buffer - * $internalErrors array and preg_match -> should be removed. We should catch the first 4 symbols from the string (this will be StatusCode), - * all the remaining string will be ErrorInfo - */ - $errCodes = array_keys( $internalErrors ); - $regexp = '/^(' . implode( '|',array_values( $errCodes ) ).')/i'; - foreach( $errInfos as $errInfoObj ) - { - foreach( $errInfoObj as $key => $errInfo ) - { - $tempResp = array(); - $tempResp["ExtraErrCode"] = $buffer->StatusCode; - $tempResp["ExtraErrKey"] = ""; - $tempResp["ExtraErrMsg"] = $errInfo; - - preg_match($regexp, $errInfo, $matches); - if( !empty( $matches )) - { - $tempResp["ExtraErrCode"] = $matches[1]; - if( $comeFromString ) - $tempResp["ExtraErrKey"] = ''; - else - $tempResp["ExtraErrKey"] = $key; - $tempResp["ExtraErrMsg"] = $internalErrors[$matches[1]]; - } - $response[] = $tempResp ; - } - } - } - } - // Check if is $response empty ! - if( empty( $response ) ) - { - $response = array( (object)array( "ExtraErrCode" => $this->_info['http_code'], "ExtraErrKey" => "", "ExtraErrMsg" => "" ) ); - } - - $buffer->ExtraError = $response ; - $buffer = json_encode( $buffer ); - } - -} diff --git a/assets/images/glyphicons-halflings-white.png b/assets/images/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a..00000000 Binary files a/assets/images/glyphicons-halflings-white.png and /dev/null differ diff --git a/assets/images/glyphicons-halflings.png b/assets/images/glyphicons-halflings.png deleted file mode 100644 index 8bc9e642..00000000 Binary files a/assets/images/glyphicons-halflings.png and /dev/null differ diff --git a/assets/images/index.html b/assets/images/index.html deleted file mode 100644 index 3af63015..00000000 --- a/assets/images/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/loading.gif b/assets/images/loading.gif deleted file mode 100644 index 1441be36..00000000 Binary files a/assets/images/loading.gif and /dev/null differ diff --git a/assets/images/ui-bg_flat_75_ffffff_40x100.png b/assets/images/ui-bg_flat_75_ffffff_40x100.png deleted file mode 100644 index ac8b229a..00000000 Binary files a/assets/images/ui-bg_flat_75_ffffff_40x100.png and /dev/null differ diff --git a/assets/images/ui-bg_glass_55_fbf9ee_1x400.png b/assets/images/ui-bg_glass_55_fbf9ee_1x400.png deleted file mode 100644 index d96643ed..00000000 Binary files a/assets/images/ui-bg_glass_55_fbf9ee_1x400.png and /dev/null differ diff --git a/assets/images/ui-bg_glass_65_ffffff_1x400.png b/assets/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 53271d71..00000000 Binary files a/assets/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/assets/images/ui-bg_glass_75_dadada_1x400.png b/assets/images/ui-bg_glass_75_dadada_1x400.png deleted file mode 100644 index a9bdbac5..00000000 Binary files a/assets/images/ui-bg_glass_75_dadada_1x400.png and /dev/null differ diff --git a/assets/images/ui-bg_glass_75_e6e6e6_1x400.png b/assets/images/ui-bg_glass_75_e6e6e6_1x400.png deleted file mode 100644 index 7ec65c6b..00000000 Binary files a/assets/images/ui-bg_glass_75_e6e6e6_1x400.png and /dev/null differ diff --git a/assets/images/ui-bg_glass_95_fef1ec_1x400.png b/assets/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100644 index 2c77838c..00000000 Binary files a/assets/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100644 index cf679d66..00000000 Binary files a/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ diff --git a/assets/images/ui-icons_222222_256x240.png b/assets/images/ui-icons_222222_256x240.png deleted file mode 100644 index e9c8e16a..00000000 Binary files a/assets/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/assets/images/ui-icons_2e83ff_256x240.png b/assets/images/ui-icons_2e83ff_256x240.png deleted file mode 100644 index f2bf8388..00000000 Binary files a/assets/images/ui-icons_2e83ff_256x240.png and /dev/null differ diff --git a/assets/images/ui-icons_454545_256x240.png b/assets/images/ui-icons_454545_256x240.png deleted file mode 100644 index 0cd64a21..00000000 Binary files a/assets/images/ui-icons_454545_256x240.png and /dev/null differ diff --git a/assets/images/ui-icons_888888_256x240.png b/assets/images/ui-icons_888888_256x240.png deleted file mode 100644 index d3e6e02a..00000000 Binary files a/assets/images/ui-icons_888888_256x240.png and /dev/null differ diff --git a/assets/images/ui-icons_cd0a0a_256x240.png b/assets/images/ui-icons_cd0a0a_256x240.png deleted file mode 100644 index 49370189..00000000 Binary files a/assets/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/assets/index.html b/assets/index.html deleted file mode 100644 index 3af63015..00000000 --- a/assets/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/js/ajax.js b/assets/js/ajax.js deleted file mode 100644 index ecae6c8e..00000000 --- a/assets/js/ajax.js +++ /dev/null @@ -1,23 +0,0 @@ -jQuery(document).ready(function ($) -{ - $('body').on('submit', '.subscribe-form', function (e) - { - e.preventDefault(); - var $el = $(this); - var loading = '

Please wait...

';// Loading state - var $res = $el.parent().find(".response").html(loading);// Clear previous messages - $.post(WPMailjet.ajaxurl, $el.serialize(), function (data) - { - $res.html(data); - }); - }); - - $('body').on('click', '.widget-control-close', function (e) - { - var $res = $(this).closest('form').find(".mailjet_subscribe_response"); - if (jQuery.type($res.html()) !== undefined) - { - $res.hide(); - } - }); -}); \ No newline at end of file diff --git a/assets/js/index.html b/assets/js/index.html deleted file mode 100644 index 3af63015..00000000 --- a/assets/js/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/js/mailjet.js b/assets/js/mailjet.js deleted file mode 100644 index 8c456ef4..00000000 --- a/assets/js/mailjet.js +++ /dev/null @@ -1,474 +0,0 @@ -/** - * Created with JetBrains PhpStorm. - * User: jonathan - * Date: 5/25/12 - * Time: 4:07 PM - * To change this template use File | Settings | File Templates. - */ - -jQuery(document).ready(function ($) { - - $('select[name=mailjet_initial_sync_list_id]').ready(function (e) { - $('select[name=mailjet_initial_sync_list_id]').val(''); - }); - - removeSpaces = function ($el) { - $el.val($el.val().split(' ').join('')); - }; - - $('#mailjet_username').on('blur', function () { - removeSpaces($(this)); - }); - $('#mailjet_password').on('blur', function () { - removeSpaces($(this)); - }); - - showPorts = function ($el) { - $('#mailjet_port').empty() - - if ($el.attr('checked') == 'checked') { - $('#mailjet_port').append(''); - } else { - $('#mailjet_port') - .append('') - .append('') - .append('') - .append(''); - } - }; - - $('#addContact').on('click', function (e) { - e.preventDefault(); - var contactInput = $('#firstContactAdded').clone(); - var $el = $(e.currentTarget); - $el.before(contactInput); - }); - - $('select[name=action2]').change(function (e) { - $('select[name=action]').val($(this).val()); - }); - - $('#mailjet_ssl').change(function (e) { - showPorts($(this)); - }); - - showPorts($('#mailjet_ssl')); - $('.newPropertyBtn').on('click', function () { - $('.newPropertyForm').toggle(); - }); - - $('.response').append($('.error:first, .success:first')[0]); - // code to remove double widget message on front end - var hidden = 0; - $('div.response > p').each(function(i, o){ - if ($(o).attr('listid') !== $(o).parent().parent().find('form input[name="list_id"]').val()) { - $(o).hide(); - hidden++; - } - }); - // if all are hidden, show at least one - if ($('div.response > p:visible').length === 0) { - $('div.response > p:first').show(); - } - - initAccordion(); - initStringTranslations(); - initNewPropertyForm(); - initSortable(); - - // init tabs with translations - initTabsWithTranslations(); - // hide content of disabled tabs - hideTabActivatorSiblings(); - // change Step3 content depending on language activations on Step2 - chamgeStep3DependingOnStep2ActiveTabs(); - $(document).on('focus', ':input', function () { - $(this).attr('autocomplete', 'off'); - }); - - // Validates current user inputs - validateState(); - - if (typeof $(document).tooltip === 'function') { - $('.mj-tab-content').tooltip(); - } - - // on add widget to widget area - $(document).on('widget-added', function () { - initAccordion(); - initStringTranslations(); - initNewPropertyForm(); - initSortable(); - // hide content of disabled tabs - hideTabActivatorSiblings(); - // init tabs with translations - initTabsWithTranslations(); - // change Step3 content depending on language activations on Step2 - chamgeStep3DependingOnStep2ActiveTabs(); - $(".mj-accordion").accordion('enable'); - // Validates current user inputs - validateState(); - }); - - // on widget save - $(document).on('widget-updated', function (e, widget) { - $('.mj-tab-content').tooltip(); - initAccordion(); - initStringTranslations(); - initNewPropertyForm(); - initSortable(); - // init tabs with translations - initTabsWithTranslations(); - // hide content of disabled tabs - hideTabActivatorSiblings(); - // change Step3 content depending on language activations on Step2 - chamgeStep3DependingOnStep2ActiveTabs(); - $('.mj-accordion').accordion({ - active: false, - collapsible: true, - heightStyle: 'content' - }); - $('.mj-accordion').accordion('enable'); - registerAccordionNavButtons(); - // Validates current user inputs - validateState(); - }); - - -}); - -// init tabs with translations -function initTabsWithTranslations() -{ - jQuery(".mj-tabs-menu a").click(function(event) { - event.preventDefault(); - var className = jQuery(this).attr("href"); - jQuery(className).each(function(){ - jQuery(this).parent().parent().find('li a[href="' + className + '"]').parent() - .addClass("current").siblings().removeClass("current"); - }); - jQuery(".mj-tab-content").not(className).css("display", "none"); - jQuery(className).fadeIn(); - }); -} - - - -function hideTabActivatorSiblings() -{ - jQuery('.tabActivator').each(function(){ - if (typeof jQuery(this).find('input').attr('checked') !== 'undefined') { - jQuery(this).siblings().show(); - } else { - jQuery(this).siblings().hide(); - } - }); - - jQuery('.tabActivator').on('click', function(){ - if (typeof jQuery(this).find('input').attr('checked') !== 'undefined') { - jQuery(this).siblings().show(); - } else { - jQuery(this).siblings().hide(); - } - validateState(); - }); - -} - - - -function chamgeStep3DependingOnStep2ActiveTabs() -{ - jQuery('.tabActivator').each(function(){ - if (typeof jQuery(this).attr('id') !== 'undefined') { - var arr = jQuery(this).attr('id').split('-'); - var lang = arr[4]; - var widgetId = arr[2]; - var widgetName = arr[0] + '-' + arr[1] + '-' + arr[2]; - - if (typeof jQuery(this).find('input').attr('checked') !== 'undefined') { - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).show(); - jQuery('#' + widgetName + '-mj-string-translations-' + lang).show(); - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).parent().find('div').hide(); - } else { - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).hide(); - jQuery('#' + widgetName + '-mj-string-translations-' + lang).hide(); - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).parent().find('div').show(); - } - } - }); - - jQuery('.tabActivator').on('click', function(){ - if (typeof jQuery(this).attr('id') !== 'undefined') { - var arr = jQuery(this).attr('id').split('-'); - var lang = arr[4]; - var widgetId = arr[2]; - var widgetName = arr[0] + '-' + arr[1] + '-' + arr[2]; - - if (typeof jQuery(this).find('input').attr('checked') !== 'undefined') { - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).show(); - jQuery('#' + widgetName + '-mj-string-translations-' + lang).show(); - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).parent().find('div').hide(); - } else { - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).hide(); - jQuery('#' + widgetName + '-mj-string-translations-' + lang).hide(); - jQuery('a#' + widgetName + '-tabLinkStep3-' + lang).parent().find('div').show(); - } - } - }); -} - - -function registerAccordionNavButtons() { - jQuery('.mj-accordion .next, .mj-accordion .previous').unbind('click').on('click', (function (e) { - e.preventDefault(); - jQuery(e.currentTarget).closest('.mj-accordion').accordion( - 'option', - 'active', - Math.round((jQuery(this).is('.next') === true ? 1 : -1) + - ((jQuery(this).parent().parent().parent().index() - 1) / 2)) - ); - })); -} - -// http://api.jqueryui.com/sortable -function initSortable() { - if (typeof jQuery(".sortable1, .sortable2").sortable === 'function') { - jQuery(".sortable1, .sortable2").sortable({ - cancel: ".ui-state-disabled", - items: "li:not(.ui-state-disabled)", - connectWith: ".connectedSortable", - // Triggered when the sortable is created. - create: function (event, ui) { - hideMetaInputFields(ui); - var sortable2 = jQuery('.sortable2'); - jQuery.each(sortable2, function () { - jQuery.each(jQuery(this).find('li'), function (k, v) { - showMetaInputFields(k, v); - }); - }) - }, - // Triggered when an item from a connected sortable list has been dropped into another list. The latter is the event target. - receive: function (event, ui) { - var children = jQuery(this).children(); - if (jQuery(children.context).attr('class').search('sortable2') !== -1 && children.length > 4) { - alert('Please note that currently you may have a maximum of 3 contact properties in your widget'); - jQuery(this).sortable('cancel'); - jQuery(ui.sender).sortable('cancel'); - } - }, - // Triggered when the user stopped sorting and the DOM position has changed. - update: function (event, ui) { - var children = jQuery(this).children(); - var sortable = jQuery(children.context); - var newElements = jQuery(sortable[sortable.length - 1]); - if (newElements.hasClass('sortable2')) { - hideMetaInputFields(ui); - jQuery.each(newElements[0].children, function (k, v) { - showMetaInputFieldsOnUpdate(k, v); - }); - } - } - }); - jQuery("#sortable1 li, #sortable2 li").disableSelection(); - } -} - -function hideMetaInputFields(ui) { - var obj = jQuery.isEmptyObject(ui) ? jQuery('.map-meta-properties div') : - jQuery(ui.item).parent().parent().parent().parent().parent().find('.map-meta-properties div'); - obj.each(function () { - jQuery(this).hide().find('input[type!="select"]').prop('disabled', true); - }); -} - -function showMetaInputFields(k, v) { - if (k === 0) { - return; - } - var metaProperty = jQuery(v); - if (metaProperty.parent().hasClass('sortable2')) { - var inputDiv = metaProperty.parent().parent().parent().parent().parent() - .find('.map-meta-properties div:nth-child(' + k + ')'); - if (jQuery(inputDiv.context).attr('class') === 'ui-state-disabled') { - return; - } - inputDiv.show(); - inputDiv.find('label').html(metaProperty.text().trim() + ':'); - inputDiv.find('input[type="hidden"]').val(metaProperty.text().trim()); - inputDiv.find('input').prop('disabled', false); - - var arr = jQuery(v.firstChild).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().attr('id'); - if (typeof arr === 'undefined') { - return; - } - arr = arr.split('-'); - var widgetId = arr[1]; - - var langs = ['en', 'fr', 'de', 'es']; - - jQuery.each(langs, function (kk, language) { - for (var i = 1; i <= 3; i++) { - if (typeof mjGlobalVars !== 'undefined' - && typeof mjGlobalVars[widgetId] !== 'undefined' - && typeof mjGlobalVars[widgetId]['metaPropertyName' + i + language] !== 'undefined' - && mjGlobalVars[widgetId]['metaProperty' + i + language] !== '' - && mjGlobalVars[widgetId]['metaPropertyName' + i + language] === metaProperty.text().trim()) { - inputDiv.find('input[type="text"]').val(mjGlobalVars[widgetId]['metaProperty' + i + language]); - return; - } else { - //inputDiv.find('input[type="text"]').val(''); - } - } - }); - } -} - - - -function showMetaInputFieldsOnUpdate(k, v) { - if (k === 0) { - return; - } - var metaProperty = jQuery(v); - if (metaProperty.parent().hasClass('sortable2')) { - var inputDiv = metaProperty.parent().parent().parent().parent().parent() - .find('.map-meta-properties div:nth-child(' + k + ')'); - if (jQuery(inputDiv.context).attr('class') === 'ui-state-disabled') { - return; - } - inputDiv.show(); - inputDiv.find('label').html(metaProperty.text().trim() + ':'); - inputDiv.find('input[type="hidden"]').val(metaProperty.text().trim()); - inputDiv.find('input').prop('disabled', false); - - var arr = jQuery(v.firstChild).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().attr('id'); - if (typeof arr === 'undefined') { - return; - } - arr = arr.split('-'); - var widgetId = arr[1]; - - //var widgetId = metaProperty.closest(".widget").find(".widget_number").val(); - - inputDiv.find('input[type="hidden"]').each(function(){ - var arrHiddenInput = jQuery(this).attr('id').split('-'); - var widgetId = arrHiddenInput[2]; - var widgetName = arrHiddenInput[0] + '-' + arrHiddenInput[1] + '-' + arrHiddenInput[2]; - var arrHiddenInputName = arrHiddenInput[3].split('metaPropertyName'); - - var lang = arrHiddenInputName[1].substring(1); - if (typeof mjGlobalVarsProps !== 'undefined' - && typeof mjGlobalVarsProps[widgetId] !== 'undefined' - && typeof mjGlobalVarsProps[widgetId][metaProperty.text().trim() + lang] !== 'undefined' - && mjGlobalVarsProps[widgetId][metaProperty.text().trim() + lang] !== '') { - jQuery('#' + widgetName + '-metaProperty' + arrHiddenInputName[1]).val(mjGlobalVarsProps[widgetId][metaProperty.text().trim() + lang]); - } else { - jQuery('#' + widgetName + '-metaProperty' + arrHiddenInputName[1]).val(''); - } - }); - } -} - - -function initNewPropertyForm() { - jQuery('.new-meta-submit').on('click', function (e) { - var name = jQuery(this).parent().parent().find('input[type="text"]'); - var dataType = jQuery(this).parent().parent().find('select'); - if (name.val() === '' || dataType.val() === '') { - alert('Please enter Name and Contact property type'); - return false; - } else { - e.preventDefault(); - jQuery.ajax({ - dataType: "json", - url: ajaxurl, - data: { - 'action': 'mailjet_subscribe_ajax_add_meta_property', - 'name': name.val(), - 'type': dataType.val() - }, - success: function (data) { - jQuery('.new-meta-property-response').html(data.message).removeClass('green red').addClass(data.status === 'OK' ? 'green' : 'red'); - if (data.status === 'OK') { - jQuery('div.noProperties').hide(); - jQuery('div.yesProperties').show(); - jQuery('.sortable').show(); - jQuery('.sortable1').append('
  •     ' + name.val() + '
  • '); - } - jQuery(name).val('').focus(); - }, - error: function (errorThrown) { - jQuery('.new-meta-property-response').html(errorThrown).removeClass('green red').addClass('red'); - } - }); - } - }); -} - -function initStringTranslations() { - jQuery('.mj-string-translations').hide(); - jQuery('.mj-translations-title a').unbind('click').click(function () { - jQuery('.mj-string-translations').toggle('slow'); - }); -} - -function checkRequiredField(o) { - if(Boolean(jQuery(o).val())){ - jQuery(o).removeClass('borderRed'); - jQuery('.mj-accordion .next, .mj-accordion .previous, input[type="submit"]').each(function () { - jQuery(this).prop('disabled', false); - }); - } else { - jQuery(o).addClass('borderRed'); - jQuery('.mj-accordion .next, .mj-accordion .previous, input[type="submit"]').each(function () { - jQuery(this).prop('disabled', true); - }); - } - // check for empty siblings input fields; check each input field for each activated language tab - jQuery(o).closest('.mj-tabs-container').find('.mj-tab-content').each(function(){ - if(jQuery(this).find('.tabActivator input[type="checkbox"]').prop('checked') === true){ - jQuery(this).find('input:enabled[type="text"], input:enabled[type="select"]').each(function(){ - if(!Boolean(jQuery(this).val())){ - jQuery(this).addClass('borderRed'); - jQuery('.mj-accordion .next, .mj-accordion .previous, input[type="submit"]').each(function () { - jQuery(this).prop('disabled', true); - }); - //return false; - } - }); - } - }); - //return true; -} -function initAccordion() { - if (jQuery(".mj-accordion").accordion !== undefined) { - jQuery(".mj-accordion").accordion({ - disabled: true, - heightStyle: "content" - }); - jQuery('.mj-accordion .next, .mj-accordion .previous').click(function (e) { - e.preventDefault(); - validateState(); - jQuery(e.currentTarget).closest('.mj-accordion').accordion( - 'option', - 'active', - (jQuery(e.currentTarget).closest('.mj-accordion').accordion('option', 'active') + - (jQuery(this).is('.next') ? 1 : -1)) - ); - }); - } -} - - -function validateState() -{ - jQuery('.widget.open .mj-tab input[type="text"]:enabled, .widget.open .mj-tab select').each(function () { - checkRequiredField(this); - }); - jQuery('.widget.open .mj-tab input[type="text"]:enabled, .widget.open .mj-tab select').unbind('keyup').on('keyup', function (e) { - e.preventDefault(); - checkRequiredField(this); - }); - -} \ No newline at end of file diff --git a/assets/mailjet-jquery-ui.css b/assets/mailjet-jquery-ui.css deleted file mode 100644 index 12e8dfcb..00000000 --- a/assets/mailjet-jquery-ui.css +++ /dev/null @@ -1,1232 +0,0 @@ -/*! jQuery UI - v1.11.4 - 2015-03-11 -* http://jqueryui.com -* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ - -/* Layout helpers -----------------------------------*/ -.mailjet-widget-container .ui-helper-hidden { - display: none; -} -.mailjet-widget-container .ui-helper-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} -.mailjet-widget-container .ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; -} -.mailjet-widget-container .ui-helper-clearfix:before, -.mailjet-widget-container .ui-helper-clearfix:after { - content: ""; - display: table; - border-collapse: collapse; -} -.mailjet-widget-container .ui-helper-clearfix:after { - clear: both; -} -.mailjet-widget-container .ui-helper-clearfix { - min-height: 0; /* support: IE7 */ -} -.mailjet-widget-container .ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; - filter:Alpha(Opacity=0); /* support: IE8 */ -} - -.mailjet-widget-container .ui-front { - z-index: 100; -} - - -/* Interaction Cues -----------------------------------*/ -.mailjet-widget-container .ui-state-disabled { - cursor: default !important; -} - - -/* Icons -----------------------------------*/ - -/* states and images */ -.mailjet-widget-container .ui-icon { - display: block; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; -} - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.mailjet-widget-container .ui-widget-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.mailjet-widget-container .ui-accordion .ui-accordion-header { - display: block; - cursor: pointer; - position: relative; - margin: 2px 0 0 0; - padding: .5em .5em .5em .7em; - min-height: 0; /* support: IE7 */ - font-size: 100%; - height: 30px; - line-height: 30px; - background-image: none; - background-color: #f1f1f1; - border-radius: 0; -} - -.mailjet-widget-container .ui-accordion-header.ui-accordion-header-active { - background-color: #22272c; - color: #ffffff; - border: 1px solid #22272c; - border-top-left-radius: 4px; - border-top-right-radius: 4px; -} - -.mailjet-widget-container .ui-accordion .ui-accordion-icons { - padding-left: 2.2em; -} -.mailjet-widget-container .ui-accordion .ui-accordion-icons .ui-accordion-icons { - padding-left: 2.2em; -} -.mailjet-widget-container .ui-accordion .ui-accordion-header .ui-accordion-header-icon { - position: absolute; - left: .5em; - top: 50%; - margin-top: -8px; -} -.mailjet-widget-container .ui-accordion .ui-accordion-content { - padding: 1em 2.2em; - border-top: 0; - overflow: auto; -} -.mailjet-widget-container .ui-autocomplete { - position: absolute; - top: 0; - left: 0; - cursor: default; -} -.mailjet-widget-container .ui-button { - display: inline-block; - position: relative; - padding: 0; - line-height: normal; - margin-right: .1em; - cursor: pointer; - vertical-align: middle; - text-align: center; - overflow: visible; /* removes extra width in IE */ -} -.mailjet-widget-container .ui-button, -.mailjet-widget-container .ui-button:link, -.mailjet-widget-container .ui-button:visited, -.mailjet-widget-container .ui-button:hover, -.mailjet-widget-container .ui-button:active { - text-decoration: none; -} -/* to make room for the icon, a width needs to be set here */ -.mailjet-widget-container .ui-button-icon-only { - width: 2.2em; -} -/* button elements seem to need a little more width */ -button.ui-button-icon-only { - width: 2.4em; -} -.mailjet-widget-container .ui-button-icons-only { - width: 3.4em; -} -button.ui-button-icons-only { - width: 3.7em; -} - -/* button text element */ -.mailjet-widget-container .ui-button .ui-button-text { - display: block; - line-height: normal; -} -.mailjet-widget-container .ui-button-text-only .ui-button-text { - padding: .4em 1em; -} -.mailjet-widget-container .ui-button-icon-only .ui-button-text, -.mailjet-widget-container .ui-button-icons-only .ui-button-text { - padding: .4em; - text-indent: -9999999px; -} -.mailjet-widget-container .ui-button-text-icon-primary .ui-button-text, -.mailjet-widget-container .ui-button-text-icons .ui-button-text { - padding: .4em 1em .4em 2.1em; -} -.mailjet-widget-container .ui-button-text-icon-secondary .ui-button-text, -.mailjet-widget-container .ui-button-text-icons .ui-button-text { - padding: .4em 2.1em .4em 1em; -} -.mailjet-widget-container .ui-button-text-icons .ui-button-text { - padding-left: 2.1em; - padding-right: 2.1em; -} -/* no icon support for input elements, provide padding by default */ -input.ui-button { - padding: .4em 1em; -} - -/* button icon element(s) */ -.mailjet-widget-container .ui-button-icon-only .ui-icon, -.mailjet-widget-container .ui-button-text-icon-primary .ui-icon, -.mailjet-widget-container .ui-button-text-icon-secondary .ui-icon, -.mailjet-widget-container .ui-button-text-icons .ui-icon, -.mailjet-widget-container .ui-button-icons-only .ui-icon { - position: absolute; - top: 50%; - margin-top: -8px; -} -.mailjet-widget-container .ui-button-icon-only .ui-icon { - left: 50%; - margin-left: -8px; -} -.mailjet-widget-container .ui-button-text-icon-primary .ui-button-icon-primary, -.mailjet-widget-container .ui-button-text-icons .ui-button-icon-primary, -.mailjet-widget-container .ui-button-icons-only .ui-button-icon-primary { - left: .5em; -} -.mailjet-widget-container .ui-button-text-icon-secondary .ui-button-icon-secondary, -.mailjet-widget-container .ui-button-text-icons .ui-button-icon-secondary, -.mailjet-widget-container .ui-button-icons-only .ui-button-icon-secondary { - right: .5em; -} - -/* button sets */ -.mailjet-widget-container .ui-buttonset { - margin-right: 7px; -} -.mailjet-widget-container .ui-buttonset .ui-button { - margin-left: 0; - margin-right: -.3em; -} - -/* workarounds */ -/* reset extra padding in Firefox, see h5bp.com/l */ -input.ui-button::-moz-focus-inner, -button.ui-button::-moz-focus-inner { - border: 0; - padding: 0; -} -.mailjet-widget-container .ui-datepicker { - width: 17em; - padding: .2em .2em 0; - display: none; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-header { - position: relative; - padding: .2em 0; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-prev, -.mailjet-widget-container .ui-datepicker .ui-datepicker-next { - position: absolute; - top: 2px; - width: 1.8em; - height: 1.8em; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-prev-hover, -.mailjet-widget-container .ui-datepicker .ui-datepicker-next-hover { - top: 1px; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-prev { - left: 2px; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-next { - right: 2px; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-prev-hover { - left: 1px; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-next-hover { - right: 1px; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-prev span, -.mailjet-widget-container .ui-datepicker .ui-datepicker-next span { - display: block; - position: absolute; - left: 50%; - margin-left: -8px; - top: 50%; - margin-top: -8px; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-title { - margin: 0 2.3em; - line-height: 1.8em; - text-align: center; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-title select { - font-size: 1em; - margin: 1px 0; -} -.mailjet-widget-container .ui-datepicker select.ui-datepicker-month, -.mailjet-widget-container .ui-datepicker select.ui-datepicker-year { - width: 45%; -} -.mailjet-widget-container .ui-datepicker table { - width: 100%; - font-size: .9em; - border-collapse: collapse; - margin: 0 0 .4em; -} -.mailjet-widget-container .ui-datepicker th { - padding: .7em .3em; - text-align: center; - font-weight: bold; - border: 0; -} -.mailjet-widget-container .ui-datepicker td { - border: 0; - padding: 1px; -} -.mailjet-widget-container .ui-datepicker td span, -.mailjet-widget-container .ui-datepicker td a { - display: block; - padding: .2em; - text-align: right; - text-decoration: none; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-buttonpane { - background-image: none; - margin: .7em 0 0 0; - padding: 0 .2em; - border-left: 0; - border-right: 0; - border-bottom: 0; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-buttonpane button { - float: right; - margin: .5em .2em .4em; - cursor: pointer; - padding: .2em .6em .3em .6em; - width: auto; - overflow: visible; -} -.mailjet-widget-container .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { - float: left; -} - -/* with multiple calendars */ -.mailjet-widget-container .ui-datepicker.ui-datepicker-multi { - width: auto; -} -.mailjet-widget-container .ui-datepicker-multi .ui-datepicker-group { - float: left; -} -.mailjet-widget-container .ui-datepicker-multi .ui-datepicker-group table { - width: 95%; - margin: 0 auto .4em; -} -.mailjet-widget-container .ui-datepicker-multi-2 .ui-datepicker-group { - width: 50%; -} -.mailjet-widget-container .ui-datepicker-multi-3 .ui-datepicker-group { - width: 33.3%; -} -.mailjet-widget-container .ui-datepicker-multi-4 .ui-datepicker-group { - width: 25%; -} -.mailjet-widget-container .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, -.mailjet-widget-container .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width: 0; -} -.mailjet-widget-container .ui-datepicker-multi .ui-datepicker-buttonpane { - clear: left; -} -.mailjet-widget-container .ui-datepicker-row-break { - clear: both; - width: 100%; - font-size: 0; -} - -/* RTL support */ -.mailjet-widget-container .ui-datepicker-rtl { - direction: rtl; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-prev { - right: 2px; - left: auto; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-next { - left: 2px; - right: auto; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-prev:hover { - right: 1px; - left: auto; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-next:hover { - left: 1px; - right: auto; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-buttonpane { - clear: right; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-buttonpane button { - float: left; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-group { - float: right; -} -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, -.mailjet-widget-container .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { - border-right-width: 0; - border-left-width: 1px; -} -.mailjet-widget-container .ui-dialog { - overflow: hidden; - position: absolute; - top: 0; - left: 0; - padding: .2em; - outline: 0; -} -.mailjet-widget-container .ui-dialog .ui-dialog-titlebar { - padding: .4em 1em; - position: relative; -} -.mailjet-widget-container .ui-dialog .ui-dialog-title { - float: left; - margin: .1em 0; - white-space: nowrap; - width: 90%; - overflow: hidden; - text-overflow: ellipsis; -} -.mailjet-widget-container .ui-dialog .ui-dialog-titlebar-close { - position: absolute; - right: .3em; - top: 50%; - width: 20px; - margin: -10px 0 0 0; - padding: 1px; - height: 20px; -} -.mailjet-widget-container .ui-dialog .ui-dialog-content { - position: relative; - border: 0; - padding: .5em 1em; - background: none; - overflow: auto; -} -.mailjet-widget-container .ui-dialog .ui-dialog-buttonpane { - text-align: left; - border-width: 1px 0 0 0; - background-image: none; - margin-top: .5em; - padding: .3em 1em .5em .4em; -} -.mailjet-widget-container .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { - float: right; -} -.mailjet-widget-container .ui-dialog .ui-dialog-buttonpane button { - margin: .5em .4em .5em 0; - cursor: pointer; -} -.mailjet-widget-container .ui-dialog .ui-resizable-se { - width: 12px; - height: 12px; - right: -5px; - bottom: -5px; - background-position: 16px 16px; -} -.mailjet-widget-container .ui-draggable .ui-dialog-titlebar { - cursor: move; -} -.mailjet-widget-container .ui-draggable-handle { - -ms-touch-action: none; - touch-action: none; -} -.mailjet-widget-container .ui-menu { - list-style: none; - padding: 0; - margin: 0; - display: block; - outline: none; -} -.mailjet-widget-container .ui-menu .ui-menu { - position: absolute; -} -.mailjet-widget-container .ui-menu .ui-menu-item { - position: relative; - margin: 0; - padding: 3px 1em 3px .4em; - cursor: pointer; - min-height: 0; /* support: IE7 */ - /* support: IE10, see #8844 */ - list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); -} -.mailjet-widget-container .ui-menu .ui-menu-divider { - margin: 5px 0; - height: 0; - font-size: 0; - line-height: 0; - border-width: 1px 0 0 0; -} -.mailjet-widget-container .ui-menu .ui-state-focus, -.mailjet-widget-container .ui-menu .ui-state-active { - margin: -1px; -} - -/* icon support */ -.mailjet-widget-container .ui-menu-icons { - position: relative; -} -.mailjet-widget-container .ui-menu-icons .ui-menu-item { - padding-left: 2em; -} - -/* left-aligned */ -.mailjet-widget-container .ui-menu .ui-icon { - position: absolute; - top: 0; - bottom: 0; - left: .2em; - margin: auto 0; -} - -/* right-aligned */ -.mailjet-widget-container .ui-menu .ui-menu-icon { - left: auto; - right: 0; -} -.mailjet-widget-container .ui-progressbar { - height: 2em; - text-align: left; - overflow: hidden; -} -.mailjet-widget-container .ui-progressbar .ui-progressbar-value { - margin: -1px; - height: 100%; -} -.mailjet-widget-container .ui-progressbar .ui-progressbar-overlay { - background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); - height: 100%; - filter: alpha(opacity=25); /* support: IE8 */ - opacity: 0.25; -} -.mailjet-widget-container .ui-progressbar-indeterminate .ui-progressbar-value { - background-image: none; -} -.mailjet-widget-container .ui-resizable { - position: relative; -} -.mailjet-widget-container .ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - -ms-touch-action: none; - touch-action: none; -} -.mailjet-widget-container .ui-resizable-disabled .ui-resizable-handle, -.mailjet-widget-container .ui-resizable-autohide .ui-resizable-handle { - display: none; -} -.mailjet-widget-container .ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0; -} -.mailjet-widget-container .ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0; -} -.mailjet-widget-container .ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0; - height: 100%; -} -.mailjet-widget-container .ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0; - height: 100%; -} -.mailjet-widget-container .ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; -} -.mailjet-widget-container .ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; -} -.mailjet-widget-container .ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; -} -.mailjet-widget-container .ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} -.mailjet-widget-container .ui-selectable { - -ms-touch-action: none; - touch-action: none; -} -.mailjet-widget-container .ui-selectable-helper { - position: absolute; - z-index: 100; - border: 1px dotted black; -} -.mailjet-widget-container .ui-selectmenu-menu { - padding: 0; - margin: 0; - position: absolute; - top: 0; - left: 0; - display: none; -} -.mailjet-widget-container .ui-selectmenu-menu .ui-menu { - overflow: auto; - /* Support: IE7 */ - overflow-x: hidden; - padding-bottom: 1px; -} -.mailjet-widget-container .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { - font-size: 1em; - font-weight: bold; - line-height: 1.5; - padding: 2px 0.4em; - margin: 0.5em 0 0 0; - height: auto; - border: 0; -} -.mailjet-widget-container .ui-selectmenu-open { - display: block; -} -.mailjet-widget-container .ui-selectmenu-button { - display: inline-block; - overflow: hidden; - position: relative; - text-decoration: none; - cursor: pointer; -} -.mailjet-widget-container .ui-selectmenu-button span.ui-icon { - right: 0.5em; - left: auto; - margin-top: -8px; - position: absolute; - top: 50%; -} -.mailjet-widget-container .ui-selectmenu-button span.ui-selectmenu-text { - text-align: left; - padding: 0.4em 2.1em 0.4em 1em; - display: block; - line-height: 1.4; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.mailjet-widget-container .ui-slider { - position: relative; - text-align: left; -} -.mailjet-widget-container .ui-slider .ui-slider-handle { - position: absolute; - z-index: 2; - width: 1.2em; - height: 1.2em; - cursor: default; - -ms-touch-action: none; - touch-action: none; -} -.mailjet-widget-container .ui-slider .ui-slider-range { - position: absolute; - z-index: 1; - font-size: .7em; - display: block; - border: 0; - background-position: 0 0; -} - -/* support: IE8 - See #6727 */ -.mailjet-widget-container .ui-slider.ui-state-disabled .ui-slider-handle, -.mailjet-widget-container .ui-slider.ui-state-disabled .ui-slider-range { - filter: inherit; -} - -.mailjet-widget-container .ui-slider-horizontal { - height: .8em; -} -.mailjet-widget-container .ui-slider-horizontal .ui-slider-handle { - top: -.3em; - margin-left: -.6em; -} -.mailjet-widget-container .ui-slider-horizontal .ui-slider-range { - top: 0; - height: 100%; -} -.mailjet-widget-container .ui-slider-horizontal .ui-slider-range-min { - left: 0; -} -.mailjet-widget-container .ui-slider-horizontal .ui-slider-range-max { - right: 0; -} - -.mailjet-widget-container .ui-slider-vertical { - width: .8em; - height: 100px; -} -.mailjet-widget-container .ui-slider-vertical .ui-slider-handle { - left: -.3em; - margin-left: 0; - margin-bottom: -.6em; -} -.mailjet-widget-container .ui-slider-vertical .ui-slider-range { - left: 0; - width: 100%; -} -.mailjet-widget-container .ui-slider-vertical .ui-slider-range-min { - bottom: 0; -} -.mailjet-widget-container .ui-slider-vertical .ui-slider-range-max { - top: 0; -} -.mailjet-widget-container .ui-sortable-handle { - -ms-touch-action: none; - touch-action: none; -} -.mailjet-widget-container .ui-spinner { - position: relative; - display: inline-block; - overflow: hidden; - padding: 0; - vertical-align: middle; -} -.mailjet-widget-container .ui-spinner-input { - border: none; - background: none; - color: inherit; - padding: 0; - margin: .2em 0; - vertical-align: middle; - margin-left: .4em; - margin-right: 22px; -} -.mailjet-widget-container .ui-spinner-button { - width: 16px; - height: 50%; - font-size: .5em; - padding: 0; - margin: 0; - text-align: center; - position: absolute; - cursor: default; - display: block; - overflow: hidden; - right: 0; -} -/* more specificity required here to override default borders */ -.mailjet-widget-container .ui-spinner a.ui-spinner-button { - border-top: none; - border-bottom: none; - border-right: none; -} -/* vertically center icon */ -.mailjet-widget-container .ui-spinner .ui-icon { - position: absolute; - margin-top: -8px; - top: 50%; - left: 0; -} -.mailjet-widget-container .ui-spinner-up { - top: 0; -} -.mailjet-widget-container .ui-spinner-down { - bottom: 0; -} - -/* TR overrides */ -.mailjet-widget-container .ui-spinner .ui-icon-triangle-1-s { - /* need to fix icons sprite */ - background-position: -65px -16px; -} -.mailjet-widget-container .ui-tabs { - position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ - padding: .2em; -} -.mailjet-widget-container .ui-tabs .ui-tabs-nav { - margin: 0; - padding: .2em .2em 0; -} -.mailjet-widget-container .ui-tabs .ui-tabs-nav li { - list-style: none; - float: left; - position: relative; - top: 0; - margin: 1px .2em 0 0; - border-bottom-width: 0; - padding: 0; - white-space: nowrap; -} -.mailjet-widget-container .ui-tabs .ui-tabs-nav .ui-tabs-anchor { - float: left; - padding: .5em 1em; - text-decoration: none; -} -.mailjet-widget-container .ui-tabs .ui-tabs-nav li.ui-tabs-active { - margin-bottom: -1px; - padding-bottom: 1px; -} -.mailjet-widget-container .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, -.mailjet-widget-container .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, -.mailjet-widget-container .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { - cursor: text; -} -.mailjet-widget-container .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { - cursor: pointer; -} -.mailjet-widget-container .ui-tabs .ui-tabs-panel { - display: block; - border-width: 0; - padding: 1em 1.4em; - background: none; -} -.ui-tooltip { - padding: 8px; - position: absolute; - z-index: 9999; - max-width: 300px; - -webkit-box-shadow: 0 0 5px #aaa; - box-shadow: 0 0 5px #aaa; - background: #ffffff; -} -body .ui-tooltip { - border-width: 2px; -} - -/* Component containers -----------------------------------*/ -.mailjet-widget-container .ui-widget { - font-family: Verdana,Arial,sans-serif; - font-size: 1.1em; -} -.mailjet-widget-container .ui-widget .ui-widget { - font-size: 1em; -} -.mailjet-widget-container .ui-widget input, -.mailjet-widget-container .ui-widget select, -.mailjet-widget-container .ui-widget textarea, -.mailjet-widget-container .ui-widget button { - font-family: Verdana,Arial,sans-serif; - font-size: 1em; -} -.mailjet-widget-container .ui-widget-content { - border: 1px solid #aaaaaa; - background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; - color: #222222; -} -.mailjet-widget-container .ui-widget-content a { - color: #222222; -} -.mailjet-widget-container .ui-widget-header { - border: 1px solid #aaaaaa; - background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; - color: #222222; - font-weight: bold; -} -.mailjet-widget-container .ui-widget-header a { - color: #222222; -} - -/* Interaction states -----------------------------------*/ -.mailjet-widget-container .sortable1 .ui-state-default, -.mailjet-widget-container .ui-widget-content .ui-state-default, -.mailjet-widget-container .ui-widget-header .ui-state-default { - border: 1px solid #d3d3d3; - font-weight: bold; - color: #555555; -} -.mailjet-widget-container .sortable2 .ui-state-default { - border: 1px solid #d3d3d3; - color: #ffffff; - font-weight: bold; -} -.mailjet-widget-container .ui-state-default a, -.mailjet-widget-container .ui-state-default a:link, -.mailjet-widget-container .ui-state-default a:visited { - color: #555555; - text-decoration: none; -} -.mailjet-widget-container .ui-state-hover a, -.mailjet-widget-container .ui-state-hover a:hover, -.mailjet-widget-container .ui-state-hover a:link, -.mailjet-widget-container .ui-state-hover a:visited, -.mailjet-widget-container .ui-state-focus a, -.mailjet-widget-container .ui-state-focus a:hover, -.mailjet-widget-container .ui-state-focus a:link, -.mailjet-widget-container .ui-state-focus a:visited { - color: #212121; - text-decoration: none; -} -.mailjet-widget-container .ui-state-active, -.mailjet-widget-container .ui-widget-content .ui-state-active, -.mailjet-widget-container .ui-widget-header .ui-state-active { - border: 1px solid #aaaaaa; - font-weight: normal; - color: #212121; -} -.mailjet-widget-container .ui-state-active a, -.mailjet-widget-container .ui-state-active a:link, -.mailjet-widget-container .ui-state-active a:visited { - color: #212121; - text-decoration: none; -} - -/* Interaction Cues -----------------------------------*/ -.mailjet-widget-container .ui-state-highlight, -.mailjet-widget-container .ui-widget-content .ui-state-highlight, -.mailjet-widget-container .ui-widget-header .ui-state-highlight { - border: 1px solid #fcefa1; - background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; - color: #363636; -} -.mailjet-widget-container .ui-state-highlight a, -.mailjet-widget-container .ui-widget-content .ui-state-highlight a, -.mailjet-widget-container .ui-widget-header .ui-state-highlight a { - color: #363636; -} -.mailjet-widget-container .ui-state-error, -.mailjet-widget-container .ui-widget-content .ui-state-error, -.mailjet-widget-container .ui-widget-header .ui-state-error { - border: 1px solid #cd0a0a; - background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; - color: #cd0a0a; -} -.mailjet-widget-container .ui-state-error a, -.mailjet-widget-container .ui-widget-content .ui-state-error a, -.mailjet-widget-container .ui-widget-header .ui-state-error a { - color: #cd0a0a; -} -.mailjet-widget-container .ui-state-error-text, -.mailjet-widget-container .ui-widget-content .ui-state-error-text, -.mailjet-widget-container .ui-widget-header .ui-state-error-text { - color: #cd0a0a; -} -.mailjet-widget-container .ui-priority-primary, -.mailjet-widget-container .ui-widget-content .ui-priority-primary, -.mailjet-widget-container .ui-widget-header .ui-priority-primary { - font-weight: bold; -} -.mailjet-widget-container .ui-priority-secondary, -.mailjet-widget-container .ui-widget-content .ui-priority-secondary, -.mailjet-widget-container .ui-widget-header .ui-priority-secondary { - opacity: .7; - filter:Alpha(Opacity=70); /* support: IE8 */ - font-weight: normal; -} -.mailjet-widget-container .ui-state-disabled, -.mailjet-widget-container .ui-widget-content .ui-state-disabled, -.mailjet-widget-container .ui-widget-header .ui-state-disabled { - opacity: .35; - filter:Alpha(Opacity=35); /* support: IE8 */ - background-image: none; -} -.mailjet-widget-container .ui-state-disabled .ui-icon { - filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ -} - -/* Icons -----------------------------------*/ - -/* states and images */ -.mailjet-widget-container .ui-icon { - width: 16px; - height: 16px; -} -.mailjet-widget-container .ui-icon, -.mailjet-widget-container .ui-widget-content .ui-icon { - background-image: url("images/ui-icons_222222_256x240.png"); -} -.mailjet-widget-container .ui-widget-header .ui-icon { - background-image: url("images/ui-icons_222222_256x240.png"); -} -.mailjet-widget-container .ui-state-default .ui-icon { - background-image: url("images/ui-icons_888888_256x240.png"); -} -.mailjet-widget-container .ui-state-hover .ui-icon, -.mailjet-widget-container .ui-state-focus .ui-icon { - background-image: url("images/ui-icons_454545_256x240.png"); -} -.mailjet-widget-container .ui-state-active .ui-icon { - background-image: url("images/ui-icons_454545_256x240.png"); -} -.mailjet-widget-container .ui-state-highlight .ui-icon { - background-image: url("images/ui-icons_2e83ff_256x240.png"); -} -.mailjet-widget-container .ui-state-error .ui-icon, -.mailjet-widget-container .ui-state-error-text .ui-icon { - background-image: url("images/ui-icons_cd0a0a_256x240.png"); -} - -/* positioning */ -.mailjet-widget-container .ui-icon-blank { background-position: 16px 16px; } -.mailjet-widget-container .ui-icon-carat-1-n { background-position: 0 0; } -.mailjet-widget-container .ui-icon-carat-1-ne { background-position: -16px 0; } -.mailjet-widget-container .ui-icon-carat-1-e { background-position: -32px 0; } -.mailjet-widget-container .ui-icon-carat-1-se { background-position: -48px 0; } -.mailjet-widget-container .ui-icon-carat-1-s { background-position: -64px 0; } -.mailjet-widget-container .ui-icon-carat-1-sw { background-position: -80px 0; } -.mailjet-widget-container .ui-icon-carat-1-w { background-position: -96px 0; } -.mailjet-widget-container .ui-icon-carat-1-nw { background-position: -112px 0; } -.mailjet-widget-container .ui-icon-carat-2-n-s { background-position: -128px 0; } -.mailjet-widget-container .ui-icon-carat-2-e-w { background-position: -144px 0; } -.mailjet-widget-container .ui-icon-triangle-1-n { background-position: 0 -16px; } -.mailjet-widget-container .ui-icon-triangle-1-ne { background-position: -16px -16px; } -.mailjet-widget-container .ui-icon-triangle-1-e { background-position: -32px -16px; } -.mailjet-widget-container .ui-icon-triangle-1-se { background-position: -48px -16px; } -.mailjet-widget-container .ui-icon-triangle-1-s { background-position: -64px -16px; } -.mailjet-widget-container .ui-icon-triangle-1-sw { background-position: -80px -16px; } -.mailjet-widget-container .ui-icon-triangle-1-w { background-position: -96px -16px; } -.mailjet-widget-container .ui-icon-triangle-1-nw { background-position: -112px -16px; } -.mailjet-widget-container .ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.mailjet-widget-container .ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.mailjet-widget-container .ui-icon-arrow-1-n { background-position: 0 -32px; } -.mailjet-widget-container .ui-icon-arrow-1-ne { background-position: -16px -32px; } -.mailjet-widget-container .ui-icon-arrow-1-e { background-position: -32px -32px; } -.mailjet-widget-container .ui-icon-arrow-1-se { background-position: -48px -32px; } -.mailjet-widget-container .ui-icon-arrow-1-s { background-position: -64px -32px; } -.mailjet-widget-container .ui-icon-arrow-1-sw { background-position: -80px -32px; } -.mailjet-widget-container .ui-icon-arrow-1-w { background-position: -96px -32px; } -.mailjet-widget-container .ui-icon-arrow-1-nw { background-position: -112px -32px; } -.mailjet-widget-container .ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.mailjet-widget-container .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.mailjet-widget-container .ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.mailjet-widget-container .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.mailjet-widget-container .ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.mailjet-widget-container .ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.mailjet-widget-container .ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.mailjet-widget-container .ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.mailjet-widget-container .ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.mailjet-widget-container .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.mailjet-widget-container .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.mailjet-widget-container .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.mailjet-widget-container .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.mailjet-widget-container .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.mailjet-widget-container .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.mailjet-widget-container .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.mailjet-widget-container .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.mailjet-widget-container .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.mailjet-widget-container .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.mailjet-widget-container .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.mailjet-widget-container .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.mailjet-widget-container .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.mailjet-widget-container .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.mailjet-widget-container .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.mailjet-widget-container .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.mailjet-widget-container .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.mailjet-widget-container .ui-icon-arrow-4 { background-position: 0 -80px; } -.mailjet-widget-container .ui-icon-arrow-4-diag { background-position: -16px -80px; } -.mailjet-widget-container .ui-icon-extlink { background-position: -32px -80px; } -.mailjet-widget-container .ui-icon-newwin { background-position: -48px -80px; } -.mailjet-widget-container .ui-icon-refresh { background-position: -64px -80px; } -.mailjet-widget-container .ui-icon-shuffle { background-position: -80px -80px; } -.mailjet-widget-container .ui-icon-transfer-e-w { background-position: -96px -80px; } -.mailjet-widget-container .ui-icon-transferthick-e-w { background-position: -112px -80px; } -.mailjet-widget-container .ui-icon-folder-collapsed { background-position: 0 -96px; } -.mailjet-widget-container .ui-icon-folder-open { background-position: -16px -96px; } -.mailjet-widget-container .ui-icon-document { background-position: -32px -96px; } -.mailjet-widget-container .ui-icon-document-b { background-position: -48px -96px; } -.mailjet-widget-container .ui-icon-note { background-position: -64px -96px; } -.mailjet-widget-container .ui-icon-mail-closed { background-position: -80px -96px; } -.mailjet-widget-container .ui-icon-mail-open { background-position: -96px -96px; } -.mailjet-widget-container .ui-icon-suitcase { background-position: -112px -96px; } -.mailjet-widget-container .ui-icon-comment { background-position: -128px -96px; } -.mailjet-widget-container .ui-icon-person { background-position: -144px -96px; } -.mailjet-widget-container .ui-icon-print { background-position: -160px -96px; } -.mailjet-widget-container .ui-icon-trash { background-position: -176px -96px; } -.mailjet-widget-container .ui-icon-locked { background-position: -192px -96px; } -.mailjet-widget-container .ui-icon-unlocked { background-position: -208px -96px; } -.mailjet-widget-container .ui-icon-bookmark { background-position: -224px -96px; } -.mailjet-widget-container .ui-icon-tag { background-position: -240px -96px; } -.mailjet-widget-container .ui-icon-home { background-position: 0 -112px; } -.mailjet-widget-container .ui-icon-flag { background-position: -16px -112px; } -.mailjet-widget-container .ui-icon-calendar { background-position: -32px -112px; } -.mailjet-widget-container .ui-icon-cart { background-position: -48px -112px; } -.mailjet-widget-container .ui-icon-pencil { background-position: -64px -112px; } -.mailjet-widget-container .ui-icon-clock { background-position: -80px -112px; } -.mailjet-widget-container .ui-icon-disk { background-position: -96px -112px; } -.mailjet-widget-container .ui-icon-calculator { background-position: -112px -112px; } -.mailjet-widget-container .ui-icon-zoomin { background-position: -128px -112px; } -.mailjet-widget-container .ui-icon-zoomout { background-position: -144px -112px; } -.mailjet-widget-container .ui-icon-search { background-position: -160px -112px; } -.mailjet-widget-container .ui-icon-wrench { background-position: -176px -112px; } -.mailjet-widget-container .ui-icon-gear { background-position: -192px -112px; } -.mailjet-widget-container .ui-icon-heart { background-position: -208px -112px; } -.mailjet-widget-container .ui-icon-star { background-position: -224px -112px; } -.mailjet-widget-container .ui-icon-link { background-position: -240px -112px; } -.mailjet-widget-container .ui-icon-cancel { background-position: 0 -128px; } -.mailjet-widget-container .ui-icon-plus { background-position: -16px -128px; } -.mailjet-widget-container .ui-icon-plusthick { background-position: -32px -128px; } -.mailjet-widget-container .ui-icon-minus { background-position: -48px -128px; } -.mailjet-widget-container .ui-icon-minusthick { background-position: -64px -128px; } -.mailjet-widget-container .ui-icon-close { background-position: -80px -128px; } -.mailjet-widget-container .ui-icon-closethick { background-position: -96px -128px; } -.mailjet-widget-container .ui-icon-key { background-position: -112px -128px; } -.mailjet-widget-container .ui-icon-lightbulb { background-position: -128px -128px; } -.mailjet-widget-container .ui-icon-scissors { background-position: -144px -128px; } -.mailjet-widget-container .ui-icon-clipboard { background-position: -160px -128px; } -.mailjet-widget-container .ui-icon-copy { background-position: -176px -128px; } -.mailjet-widget-container .ui-icon-contact { background-position: -192px -128px; } -.mailjet-widget-container .ui-icon-image { background-position: -208px -128px; } -.mailjet-widget-container .ui-icon-video { background-position: -224px -128px; } -.mailjet-widget-container .ui-icon-script { background-position: -240px -128px; } -.mailjet-widget-container .ui-icon-alert { background-position: 0 -144px; } -.mailjet-widget-container .ui-icon-info { background-position: -16px -144px; } -.mailjet-widget-container .ui-icon-notice { background-position: -32px -144px; } -.mailjet-widget-container .ui-icon-help { background-position: -48px -144px; } -.mailjet-widget-container .ui-icon-check { background-position: -64px -144px; } -.mailjet-widget-container .ui-icon-bullet { background-position: -80px -144px; } -.mailjet-widget-container .ui-icon-radio-on { background-position: -96px -144px; } -.mailjet-widget-container .ui-icon-radio-off { background-position: -112px -144px; } -.mailjet-widget-container .ui-icon-pin-w { background-position: -128px -144px; } -.mailjet-widget-container .ui-icon-pin-s { background-position: -144px -144px; } -.mailjet-widget-container .ui-icon-play { background-position: 0 -160px; } -.mailjet-widget-container .ui-icon-pause { background-position: -16px -160px; } -.mailjet-widget-container .ui-icon-seek-next { background-position: -32px -160px; } -.mailjet-widget-container .ui-icon-seek-prev { background-position: -48px -160px; } -.mailjet-widget-container .ui-icon-seek-end { background-position: -64px -160px; } -.mailjet-widget-container .ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.mailjet-widget-container .ui-icon-seek-first { background-position: -80px -160px; } -.mailjet-widget-container .ui-icon-stop { background-position: -96px -160px; } -.mailjet-widget-container .ui-icon-eject { background-position: -112px -160px; } -.mailjet-widget-container .ui-icon-volume-off { background-position: -128px -160px; } -.mailjet-widget-container .ui-icon-volume-on { background-position: -144px -160px; } -.mailjet-widget-container .ui-icon-power { background-position: 0 -176px; } -.mailjet-widget-container .ui-icon-signal-diag { background-position: -16px -176px; } -.mailjet-widget-container .ui-icon-signal { background-position: -32px -176px; } -.mailjet-widget-container .ui-icon-battery-0 { background-position: -48px -176px; } -.mailjet-widget-container .ui-icon-battery-1 { background-position: -64px -176px; } -.mailjet-widget-container .ui-icon-battery-2 { background-position: -80px -176px; } -.mailjet-widget-container .ui-icon-battery-3 { background-position: -96px -176px; } -.mailjet-widget-container .ui-icon-circle-plus { background-position: 0 -192px; } -.mailjet-widget-container .ui-icon-circle-minus { background-position: -16px -192px; } -.mailjet-widget-container .ui-icon-circle-close { background-position: -32px -192px; } -.mailjet-widget-container .ui-icon-circle-triangle-e { background-position: -48px -192px; } -.mailjet-widget-container .ui-icon-circle-triangle-s { background-position: -64px -192px; } -.mailjet-widget-container .ui-icon-circle-triangle-w { background-position: -80px -192px; } -.mailjet-widget-container .ui-icon-circle-triangle-n { background-position: -96px -192px; } -.mailjet-widget-container .ui-icon-circle-arrow-e { background-position: -112px -192px; } -.mailjet-widget-container .ui-icon-circle-arrow-s { background-position: -128px -192px; } -.mailjet-widget-container .ui-icon-circle-arrow-w { background-position: -144px -192px; } -.mailjet-widget-container .ui-icon-circle-arrow-n { background-position: -160px -192px; } -.mailjet-widget-container .ui-icon-circle-zoomin { background-position: -176px -192px; } -.mailjet-widget-container .ui-icon-circle-zoomout { background-position: -192px -192px; } -.mailjet-widget-container .ui-icon-circle-check { background-position: -208px -192px; } -.mailjet-widget-container .ui-icon-circlesmall-plus { background-position: 0 -208px; } -.mailjet-widget-container .ui-icon-circlesmall-minus { background-position: -16px -208px; } -.mailjet-widget-container .ui-icon-circlesmall-close { background-position: -32px -208px; } -.mailjet-widget-container .ui-icon-squaresmall-plus { background-position: -48px -208px; } -.mailjet-widget-container .ui-icon-squaresmall-minus { background-position: -64px -208px; } -.mailjet-widget-container .ui-icon-squaresmall-close { background-position: -80px -208px; } -.mailjet-widget-container .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.mailjet-widget-container .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.mailjet-widget-container .ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.mailjet-widget-container .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.mailjet-widget-container .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.mailjet-widget-container .ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.mailjet-widget-container .ui-corner-all, -.mailjet-widget-container .ui-corner-top, -.mailjet-widget-container .ui-corner-left, -.mailjet-widget-container .ui-corner-tl { - border-top-left-radius: 4px; -} -.mailjet-widget-container .ui-corner-all, -.mailjet-widget-container .ui-corner-top, -.mailjet-widget-container .ui-corner-right, -.mailjet-widget-container .ui-corner-tr { - border-top-right-radius: 4px; -} -.mailjet-widget-container .ui-corner-all, -.mailjet-widget-container .ui-corner-bottom, -.mailjet-widget-container .ui-corner-left, -.mailjet-widget-container .ui-corner-bl { - border-bottom-left-radius: 4px; -} -.mailjet-widget-container .ui-corner-all, -.mailjet-widget-container .ui-corner-bottom, -.mailjet-widget-container .ui-corner-right, -.mailjet-widget-container .ui-corner-br { - border-bottom-right-radius: 4px; -} - -/* Overlays */ -.mailjet-widget-container .ui-widget-overlay { - background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; - opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ -} -.mailjet-widget-container .ui-widget-shadow { - margin: -8px 0 0 -8px; - padding: 8px; - background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; - opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ - border-radius: 8px; -} \ No newline at end of file diff --git a/assets/mailjet.css b/assets/mailjet.css deleted file mode 100644 index 75367104..00000000 --- a/assets/mailjet.css +++ /dev/null @@ -1,299 +0,0 @@ -/* Widget */ - -.mailjet-widget-container, .mj-accordion h3 { - min-width: 340px; - overflow: auto; -} - -.mj-accordion input[type="text"], .mj-accordion select { - height: 37px; -} - -.mj-accordion .sortable { - width: 100%; - display: inline-block; -} - -.connectedSortable.sortable2.ui-sortable { - margin: 10px 0 0; - border: 2px dashed #dddddd; - width: 99%; -} - -.mj-accordion .sortable1, .mj-accordion .sortable2 { - cursor: move; - width: 102%; - min-height: 207px; - list-style-type: none; - margin: 0; - float: left; - margin-right: 10px; - font-size: x-small; -} - -.mj-accordion .sortable1 { - border: none; -} - -.mj-accordion .sortable1 li:hover { - background-color: #d7d7d7; - color: white; -} - -.mj-accordion .sortable1 li, .mj-accordion .sortable2 li { - height: 43px; - line-height: 43px; - font-weight: bold; - font-size: 12px; - border: solid 2px #d7d7d7; - background-color: white; - background-image: none; - width: 43%; - float: left; - margin: 4px; - padding: 0 0 0 10px; -} - -.mj-accordion .sortable2 li { - width: 95%; - background-color: #009fd4; - border: none; - color: #ffffff; -} - -ul.newPropertyBtn li { - color: #555555; - font-weight: bold; - width: 97%; - border: 2px solid grey; - background-color: #ffffff; - display: inline-block; - height: 43px; - line-height: 43px; - text-align: center; - cursor: pointer; -} - -.mailjet_subscribe_response { - clear: both; - padding: 10px 0; -} - -.widget-control-actions { - margin: 10px 0; -} - -.ui-widget-content { - border: 1px solid #eeeeee; -} - -/* Language tabs */ -.ui-widget-content { - border: 1px solid #eeeeee; -} - -.mj-tabs-menu { - height: 16px; - float: left; - clear: both; -} - -.mj-tabs-menu li { - height: 29px; - line-height: 30px; - float: left; - margin-right: 2px; - background-color: #ccc; - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} - -.mj-tabs-menu li.current { - position: relative; - background-color: #009fd4; - border-bottom: 1px solid #009fd4; - z-index: 5; -} - -.mj-tabs-menu li a { - padding: 5px; - text-decoration: none; -} -.mj-tabs-menu .current a { - color: #ffffff; -} - -.mj-tab { - border: 1px solid #d4d4d1; - background-color: #fff; - float: left; - width: 100%; -} - -.mj-tab-content { - padding: 20px; - display: none; -} - -.tab-en { - display: block; -} - -div.mj-tabs-container .tabActivator { - margin: 0 0 10px 0; -} -/*end of tabs*/ - -.clear { - clear: both; -} - -.new-meta-contact-form { - margin: 8px 0 0 4px; -} - -.success { - color: green; -} - -.map-meta-properties div { - margin: 10px 0; -} - -input, select, textarea { - margin: 0; -} - -.mj-translation-entry h6 { - margin: 5px 0; -} - -.mj-translation-key { - width: 180px; -} - -.strong { - font-weight: bold; -} - -.margin-top-bottom-10 { - margin: 10px 0; -} - -.ninja { - display: none; -} - -.arrow_box { - position: relative; - background: #e6e6e6; - border: 1px solid #d3d3d3; - padding: 10px; -} -.arrow_box:after, .arrow_box:before { - top: 100%; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.arrow_box:after { - border-color: rgba(136, 183, 213, 0); - border-top-color: #d3d3d3; - border-width: 10px; - margin-left: -10px; -} -.arrow_box:before { - border-color: rgba(194, 225, 245, 0); - border-top-color: #d3d3d3; - border-width: 11px; - margin-left: -11px; -} - -.mj-accordion div{ - font-size: small; -} - -.red { - color: red; -} - -.green { - color: green; -} - -.grey { - color: grey; -} - -.floatRight { - float: right; -} - -.displayInline { - display: inline; -} - -.fontSizeSmall { - font-size: small; -} - -.borderRed { - border: 1px solid red !important; -} - -.ui-accordion .ui-accordion-content { - padding: 10px; -} - -.mj-accordion div .label { - display: inline-block; - width: 100%; - margin: 10px 0; - font-weight: bold; -} - -.widgets-holder-wrap .widget-inside { - padding: 15px; -} - -.mj-tabs-container p { - clear: both; - padding: 10px 0 0; -} - -.width48percent { - width: 48%; -} - -.newPropertyForm div { - margin: 10px 0; -} - -.sortable1 .cursorMoveImg { - background: url('images/glyphicons-halflings.png') no-repeat -169px -73px; - width: 12px; - height: 13px; - margin: 15px 10px 0 0; - position: absolute; -} - -.sortable1 .ui-state-default:hover .cursorMoveImg { - background: url('images/glyphicons-halflings-white.png') no-repeat -169px -73px; - width: 12px; - height: 13px; - margin: 15px 10px 0 0; - position: absolute; -} - -.sortable2 .cursorMoveImg { - background: url('images/glyphicons-halflings-white.png') no-repeat -169px -73px; - width: 12px; - height: 13px; - margin: 15px 10px 0 0; - position: absolute; -} \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..1aecfa27 --- /dev/null +++ b/composer.json @@ -0,0 +1,65 @@ +{ + "name": "mailjet/wp-mailjet-plugin", + "type": "wordpress-plugin", + "description": "Description", + "license": "GPL", + "keywords": ["wordpress", "plugin", "mailjet"], + "authors": [ + { + "name": "Mailjet", + "email": "plugins@mailjet.com" + } + ], + "minimum-stability": "dev", + "repositories": [ + { + "type": "vcs", + "url": "git@github.com:mailjet/mailjet-apiv3-php.git" + }, + { + "type": "vcs", + "url": "git@github.com:mailjet/Mailjet-iframe-v3.git" + }, + { + "type": "vcs", + "url": "git@github.com:jbroadway/analog.git" + }, + { + "type": "vcs", + "url": "git@github.com:raulferras/PHP-po-parser.git" + } + ], + "require": { + "php": ">=5.4", + "composer/installers": "~1.0", + "mailjet/mailjet-apiv3-php": "dev-master", + "mailjet/Mailjet-iframe-v3": "dev-master", + "sepia/po-parser": "dev-master", + "analog/analog": "dev-master" + }, + "autoload": { + "psr-4": { + "MailjetPlugin\\": "src/", + "MailjetPlugin\\Includes\\": "src/includes/", + "MailjetPlugin\\Includes\\SettingsPages\\": "src/includes/SettingsPages/", + "MailjetPlugin\\Admin\\": "src/admin/", + "MailjetPlugin\\Admin\\Partials\\": "src/admin/partials/", + "MailjetPlugin\\Front\\": "src/front/", + "MailjetPlugin\\Widget\\": "src/widget/" + } + }, + "config": { + "preferred-install": "dist" + }, + "scripts": { + "clearComposerCache": [ + "rm -rf ~/.composer/cache*" + ], + "post-install-cmd": [ + "@clearComposerCache" + ], + "post-update-cmd": [ + "@clearComposerCache" + ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..8aa30d50 --- /dev/null +++ b/composer.lock @@ -0,0 +1,740 @@ +{ + "_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": "6327003970ed41261548aec45280f402", + "packages": [ + { + "name": "analog/analog", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/jbroadway/analog.git", + "reference": "f04906be5a740794959ecceaaae307792cfe3b58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jbroadway/analog/zipball/f04906be5a740794959ecceaaae307792cfe3b58", + "reference": "f04906be5a740794959ecceaaae307792cfe3b58", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "psr/log": "1.*" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "Analog": "lib/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Johnny Broadway", + "email": "johnny@johnnybroadway.com", + "homepage": "http://www.johnnybroadway.com/" + } + ], + "description": "PHP logging class that can be extended via closures. Includes several pre-built handlers including file, mail, syslog, HTTP post, and MongoDB.", + "homepage": "https://github.com/jbroadway/analog", + "keywords": [ + "alerts", + "debug", + "debugging", + "error", + "log", + "logger", + "logging", + "syslog" + ], + "support": { + "source": "https://github.com/jbroadway/analog/tree/1.0.11-stable", + "issues": "https://github.com/jbroadway/analog/issues" + }, + "time": "2018-12-08T15:36:38+00:00" + }, + { + "name": "composer/installers", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "^4.8.36" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "time": "2018-08-27T06:10:37+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9799bbcb90ed2df488adb0924169163156483e52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9799bbcb90ed2df488adb0924169163156483e52", + "reference": "9799bbcb90ed2df488adb0924169163156483e52", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-12-07T08:18:25+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "926eaa3ff73cde2becf652b785831bcb7618568a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/926eaa3ff73cde2becf652b785831bcb7618568a", + "reference": "926eaa3ff73cde2becf652b785831bcb7618568a", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2018-10-30T00:20:04+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "5e61346ab1e1ca7d01d2f633bad9574d35717781" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/5e61346ab1e1ca7d01d2f633bad9574d35717781", + "reference": "5e61346ab1e1ca7d01d2f633bad9574d35717781", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-07T15:04:46+00:00" + }, + { + "name": "mailjet/Mailjet-iframe-v3", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:mailjet/Mailjet-iframe-v3.git", + "reference": "c7e5c5b98e76f1501b4a90d869e83934c0137234" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mailjet/Mailjet-iframe-v3/zipball/c7e5c5b98e76f1501b4a90d869e83934c0137234", + "reference": "c7e5c5b98e76f1501b4a90d869e83934c0137234", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "MailjetIframe\\": "src" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mailjet", + "email": "dev@mailjet.com", + "homepage": "https://dev.mailjet.com" + } + ], + "description": "Mailjet iFrame wrapper", + "homepage": "https://github.com/mailjet/Mailjet-iframe-v3/", + "keywords": [ + "api", + "campaign", + "email", + "iframe", + "mailjet", + "marketing", + "php" + ], + "support": { + "source": "https://github.com/mailjet/Mailjet-iframe-v3/tree/master", + "issues": "https://github.com/mailjet/Mailjet-iframe-v3/issues" + }, + "time": "2018-11-19T08:24:34+00:00" + }, + { + "name": "mailjet/mailjet-apiv3-php", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/mailjet/mailjet-apiv3-php.git", + "reference": "9d89b9a424a9631bff8e499cbbe34058481e8102" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mailjet/mailjet-apiv3-php/zipball/9d89b9a424a9631bff8e499cbbe34058481e8102", + "reference": "9d89b9a424a9631bff8e499cbbe34058481e8102", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0|~5.3", + "php": ">=5.4.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mailjet": "src/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mailjet", + "email": "dev@mailjet.com", + "homepage": "https://dev.mailjet.com" + } + ], + "description": "PHP wrapper for the Mailjet API", + "homepage": "https://github.com/mailjet/mailjet-apiv3-php/", + "keywords": [ + "api", + "email", + "mailjet", + "php", + "v3" + ], + "support": { + "source": "https://github.com/mailjet/mailjet-apiv3-php/tree/v1.4.1", + "issues": "https://github.com/mailjet/mailjet-apiv3-php/issues" + }, + "time": "2018-10-31T13:24:45+00:00" + }, + { + "name": "psr/http-message", + "version": "dev-master", + "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" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "c4421fcac1edd5a324fda73e589a5cf96e52ffd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/c4421fcac1edd5a324fda73e589a5cf96e52ffd0", + "reference": "c4421fcac1edd5a324fda73e589a5cf96e52ffd0", + "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": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-21T13:42:00+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "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.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "sepia/po-parser", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/raulferras/PHP-po-parser.git", + "reference": "ab59aeed9cf3a125caba313dd8d1e9124d3ba9c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/raulferras/PHP-po-parser/zipball/ab59aeed9cf3a125caba313dd8d1e9124d3ba9c0", + "reference": "ab59aeed9cf3a125caba313dd8d1e9124d3ba9c0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "symfony/polyfill-mbstring": "^1" + }, + "require-dev": { + "fzaninotto/faker": "^1.7", + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Sepia\\PoParser\\": "src/", + "Sepia\\Test\\": "tests/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raúl Ferràs", + "email": "raul.ferras@gmail.com", + "role": "developer" + } + ], + "description": "Gettext *.PO file parser for PHP.", + "homepage": "https://github.com/raulferras/PHP-po-parser", + "keywords": [ + "gettext", + "i10n", + "i18n", + "po" + ], + "support": { + "issues": "https://github.com/raulferras/PHP-po-parser/issues", + "source": "https://github.com/raulferras/PHP-po-parser/tree/master" + }, + "time": "2018-07-27T14:37:11+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "mailjet/mailjet-apiv3-php": 20, + "mailjet/mailjet-iframe-v3": 20, + "sepia/po-parser": 20, + "analog/analog": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [] +} diff --git a/composer.phar b/composer.phar new file mode 100644 index 00000000..322e0ff3 Binary files /dev/null and b/composer.phar differ diff --git a/contactlistswordpress.png b/contactlistswordpress.png deleted file mode 100644 index 4c4a9e36..00000000 Binary files a/contactlistswordpress.png and /dev/null differ diff --git a/i18n/index.html b/i18n/index.html deleted file mode 100644 index 3af63015..00000000 --- a/i18n/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/i18n/wp-mailjet-de_DE.mo b/i18n/wp-mailjet-de_DE.mo deleted file mode 100755 index fa529df8..00000000 Binary files a/i18n/wp-mailjet-de_DE.mo and /dev/null differ diff --git a/i18n/wp-mailjet-de_DE.po b/i18n/wp-mailjet-de_DE.po deleted file mode 100755 index 7a5ca832..00000000 --- a/i18n/wp-mailjet-de_DE.po +++ /dev/null @@ -1,515 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Mailjet for wordpress\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-03 17:54+0300\n" -"PO-Revision-Date: 2018-07-03 17:54+0300\n" -"Last-Translator: Mailjet \n" -"Language-Team: Mailjet \n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" -"X-Poedit-Basepath: ..\n" -"X-Generator: Poedit 2.0.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-SearchPath-0: .\n" - -#: mailjet-class.php:101 -msgid "Manage your Mailjet lists" -msgstr "Mailjet Listen" - -#: mailjet-class.php:101 -msgid "Lists" -msgstr "Listen" - -#: mailjet-class.php:102 -msgid "Manage your Mailjet campaigns" -msgstr "Ihre Mailjet Kampagnen verwalten" - -#: mailjet-class.php:102 mailjet-class.php:166 -msgid "Campaigns" -msgstr "Kampagnen" - -#: mailjet-class.php:103 -msgid "View your Mailjet statistics" -msgstr "Ihre Mailjet Statistiken anzeigen" - -#: mailjet-class.php:103 mailjet-class.php:174 -msgid "Statistics" -msgstr "Statistiken" - -#: mailjet-class.php:182 -msgid "Contacts" -msgstr "Kontakte" - -#: mailjet-options.php:46 -msgid "Manage your mailjet lists and settings" -msgstr "Ihre Mailjet Listen und Einstellungen verwalten" - -#: mailjet-options.php:55 -msgid "Change your mailjet settings" -msgstr "Mailjet Einstellungen " - -#: mailjet-options.php:55 wp-mailjet.php:153 -msgid "Settings" -msgstr "Einstellungen " - -#: mailjet-options.php:72 -msgid "Mailjet Settings" -msgstr "Mailjet Einstellungen " - -#: mailjet-options.php:75 -msgid "Share the love!" -msgstr "Die Liebe teilen!" - -#: mailjet-options.php:80 -msgid "Improve your email deliverability and monitor action in real time." -msgstr "" -"Ihre E-Mail-Zustellbarkeit verbessern und die Aktion in Echtzeit überwachen." - -#: mailjet-options.php:80 -msgid "Tweet" -msgstr "Tweet" - -#: mailjet-options.php:88 -#, php-format -msgid "" -"Create " -"your Mailjet account if you don't have any." -msgstr "" -"Erstellen " -"Sie Ihr Mailjet-Konto, wenn Sie keines haben." - -#: mailjet-options.php:89 -msgid "" -"Log in with your account through the login form below or visit your account " -"page to get your API keys and set up them below." -msgstr "" -"Loggen Sie sich über das Login-Formular in Ihr Konto ein oder besuchen Sie " -"Ihre Kontoseite, um Ihre API-Schlüssel zu erhalten und sie unten zu " -"konfigurieren." - -#: mailjet-options.php:90 -msgid "" -"Create a new " -"list if you don't have one or need a new one." -msgstr "" -"Neue Liste erstellen falls sie noch keine haben oder eine neue erstellen wollen. " - -#: mailjet-options.php:91 -msgid "" -"Add the email collection widget to your sidebar " -"or footer." -msgstr "" -"Fügen Sie unser E-Mail Collection Widget zu Ihrer " -"Sidebar oder Ihrem Fotter hinzu. " - -#: mailjet-options.php:92 -msgid "" -"Create a " -"campaign on mailjet.com to send your newsletter." -msgstr "" -"Erstellen Sie Ihre " -"Kampagneauf mailjet.com, um Ihre Newsletter zu verschicken. " - -#: mailjet-options.php:93 -msgid "" -"Should you have any questions or encounter any difficulties, please consult " -"our User Guide or contact our technical Support Team" -msgstr "" -"Wenn Sie irgendwelche Fragen oder Probleme haben, ziehen Sie bitte unser Nutzerhandbuch zu Rate oder kontaktieren Sie unser technisches Support-Team." - -#: mailjet-options.php:97 -msgid "Mailjet Plugin" -msgstr "Mailjet Plugin" - -#: mailjet-options.php:106 -msgid "API key" -msgstr "API Schlüssel " - -#: mailjet-options.php:107 -msgid "Secret key" -msgstr "Geheimer Key" - -#: mailjet-options.php:110 -msgid "API Settings" -msgstr "API Einstellungen " - -#: mailjet-options.php:112 -#, php-format -msgid "" -"You can get your API keys from your mailjet account. Please also make " -"sure the sender address %s is active in your account" -msgstr "" -"Ihren API Schlüssel erhalten Sie hier: Ihr Mailjet-Konto. Bitte stellen Sie " -"sicher, dass die Sender Adresse %s in Ihrem Konto aktiviert ist." - -#: mailjet-options.php:121 -msgid "Enabled" -msgstr "Zugelassen " - -#: mailjet-options.php:122 -msgid "Enable email through Mailjet" -msgstr "E-Mail via Mailjet zulassen " - -#: mailjet-options.php:126 -msgid "SSL Enabled (only with port 465)" -msgstr "SSL aktiviert (nur bei Port 465)" - -#: mailjet-options.php:128 -msgid "Enable SSL communication with mailjet.com" -msgstr "Die SSL - Kommunikation mit mailjet.com aktivieren" - -#: mailjet-options.php:140 -msgid "Port to use for SMTP communication" -msgstr "Für die SMTP-Kommunikation zu verwendender Port" - -#: mailjet-options.php:142 -msgid "Send test email" -msgstr "Test E-Mail versenden " - -#: mailjet-options.php:143 -msgid "Send test email now" -msgstr "Test E-Mail jetzt versenden " - -#: mailjet-options.php:148 -msgid "Recipient of test email" -msgstr "Empfänger der Test E-Mail " - -#: mailjet-options.php:152 -msgid "From: email address" -msgstr "Von: E-Mail Adresse " - -#: mailjet-options.php:157 -msgid "From: Name" -msgstr "Von: Name" - -#: mailjet-options.php:161 -msgid "General Settings" -msgstr "Einstellungen " - -#: mailjet-options.php:163 -msgid "" -"Enable or disable the sending of your emails through your Mailjet account" -msgstr "Senden der E-Mails durch Mailjet zulassen oder verweigern " - -#: mailjet-options.php:178 -msgid "" -"Initial sync not yet executed, choose a list and save settings to start it" -msgstr "" -"Die Erstsynchronisierung wurde noch nicht durchgeführt, wählen Sie eine " -"Liste aus und speichern Sie die Einstellungen, um sie zu starten" - -#: mailjet-options.php:196 -#, php-format -msgid "" -"Initial users sync is %s! Existing contacts subscribed to %s " -"on %s" -msgstr "" -"Die Erstsynchronisierung der Benutzer ist %s! Vorhandene Kontakte " -"angemeldet für %s am\\um %s" - -#: mailjet-options.php:201 -msgid "" -"Choose a Mailjet contact list which you would like to subscribe your " -"Wordpress users to." -msgstr "" -"Wählen Sie eine Mailjet-Kontaktliste aus, für die Sie Ihre Wordpress-Nutzer " -"anmelden möchten." - -#: mailjet-options.php:205 -msgid "Disable initial sync" -msgstr "Erstsynchronisierung deaktivieren" - -#: mailjet-options.php:212 -msgid "Subscribe existing users to this list" -msgstr "Vorhandene Benutzer für diese Liste anmelden" - -#: mailjet-options.php:215 -msgid "Disable autosubscribe" -msgstr "Automatische Anmeldung deaktivieren" - -#: mailjet-options.php:222 -msgid "Auto subscribe new users to this list" -msgstr "Neue Benutzer für diese Liste automatisch anmelden" - -#: mailjet-options.php:226 -msgid "Subscribe Wordpress users" -msgstr "Wordpress-Nutzer anmelden" - -#: mailjet-options.php:239 -msgid "" -"Comment author sync not yet activated, choose a list and save settings to " -"activate it" -msgstr "" -"Die Kommentar-Autor-Synchronisierung ist noch nicht aktiviert, wählen Sie " -"eine Liste aus und speichern Sie die Einstellungen, um sie zu aktivieren" - -#: mailjet-options.php:256 -#, php-format -msgid "Comment authors sync is %s!" -msgstr "Die Kommentar-Autor-Synchronisierung ist %s!" - -#: mailjet-options.php:262 -msgid "" -"This feature adds a \"Subscribe to our mailing list\" checkbox in the " -"\"Leave a reply\" form, so that comment authors can automatically join a " -"contact list of your choice." -msgstr "" -"Diese Funktion fügt dem Formular \"Antwort hinterlassen\" das " -"Kontrollkästchen \"Für Ihre Mailing-Liste anmelden\" hinzu, damit die " -"Kommentar-Autoren automatisch einer Kontaktliste Ihrer Wahl beitreten können." - -#: mailjet-options.php:266 -msgid "Disable comment authors subscription" -msgstr "Anmeldung von Kommentar-Autoren deaktivieren" - -#: mailjet-options.php:273 -msgid "Allow comment authors to subscribe to this list" -msgstr "Anmeldung von Kommentar-Autoren für diese Liste zulassen" - -#: mailjet-options.php:276 -msgid "Subscribe comment authors" -msgstr "Kommentar-Autor-Synchronisierung" - -#: mailjet-options.php:288 -msgid "Administrator" -msgstr "Administrator" - -#: mailjet-options.php:288 -msgid "User roles able to access the plugin" -msgstr "Benutzerrollen, die Zugriff auf das Plugin haben können" - -#: mailjet-options.php:289 -msgid "Editor" -msgstr "Editor" - -#: mailjet-options.php:290 -msgid "Author" -msgstr "Autor" - -#: mailjet-options.php:291 -msgid "Contributor" -msgstr "Referent" - -#: mailjet-options.php:292 -msgid "Subscriber" -msgstr "Unterzeichner" - -#: mailjet-options.php:295 -msgid "Access Settings" -msgstr "Zugriffseinstellungen" - -#: mailjet-options.php:297 -msgid "" -"Select which WordPress admin user roles (in addition to Administrator) will " -"also have access to the Mailjet Plug-in" -msgstr "" -"Stellen Sie die Benutzerrollen ein, die Zugriff auf das Mailjet Plugin haben " -"können" - -#: mailjet-options.php:471 -msgid "" -"Please make sure that you are using the correct API key and secret key " -"associated to your mailjet account (from email)." -msgstr "" -"Vergewissern Sie sich, dass Sie den richtigen API-Schlüssel und den zu Ihrem " -"Mailjet Konto gehörigen Geheimschlüssel (aus dem E-Mail) verwenden." - -#: mailjet-options.php:486 -msgid "Your test mail from Mailjet" -msgstr "Ihre Test E-Mail von Mailjet " - -#: mailjet-options.php:487 -#, fuzzy, php-format -msgid "Your Mailjet configuration is ok!SSL: %s Port: %s" -msgstr "Ihre Mailjet Einstellungen sind in Ordnung " - -#: mailjet-options.php:496 -msgid " and your test message was sent." -msgstr " und Ihre Test E-Mail wurde versendet. " - -#: mailjet-options.php:503 mailjet-options.php:505 -msgid "Your settings have been saved successfully" -msgstr "Ihre Einstellungen wurden erfolgreich gespeichert" - -#: mailjet-options.php:507 -msgid "" -"Your settings have been saved, but your port and SSL settings were changed " -"as follows to ensure delivery" -msgstr "" -"Ihre Einstellungen wurden gespeichert, aber Ihr Port und Ihre SSL-" -"Einstellungen wurden wie folgt geändert, um die Lieferung zu gewährleisten" - -#: mailjet-options.php:517 -#, php-format -msgid "" -"Please verify that you have entered your API and secret key correctly. If " -"this is the case and you have still this error message, please go to Account " -"API keys (%s) to regenerate a new " -"Secret Key for the plug-in." -msgstr "" -"Überprüfen Sie, ob Sie Ihre API und den Geheimschlüssel korrekt eingegeben " -"haben. Falls dies der Fall ist und Sie weiterhin diese Fehlermeldung " -"erhalten, rufen Sie die API-Schlüsseln des Kontos auf, (%s) um einen neuen Geheimschlüssel für das Plug-in zu " -"erstellen." - -#: mailjet-options.php:521 -msgid "There is an error with your settings. please correct and try again" -msgstr "" -"Es gibt ein Problem mit Ihren Einstellungen. Bitte überprüfen Sie diese und " -"probieren es erneut. " - -#: mailjet-widget.php:51 -msgid "Allows your visitors to subscribe to one of your lists" -msgstr "Ermöglicht Ihren Besuchern die Anmeldung für eine Ihrer Listen" - -#: mailjet-widget.php:57 -msgid "Mailjet Subscription widget" -msgstr "Das Mailjet-Abonnement-Widget" - -#: mailjet-widget.php:117 -msgid "" -"You are either v1 user or we could not fetch user contact properties. Please " -"contact our support team to discuss migrating to v3 user where you will have " -"contact properties available. You can still configure a Mailjet subscription " -"widget by clicking on \"Next\" button and complete step2 and step3." -msgstr "" -"Sie sind entweder ein v1-Nutzer oder die Kontakteigenschaften des Nutzers " -"konnten nicht abgerufen werden. Bitte kontaktieren Sie unser Support-Team, das " -"Sie bei der Migration zu einem v3-Nutzer gerne unterstützt, für den dann die " -"Kontakteigenschaften zur Verfügung stehen. Sie können aber auch einen " -"Mailjet-Abonnement-Widget konfigurieren, indem Sie auf die Schaltfläche " -"\"Weiter\" klicken und Schritt 2 und Schritt 3 durchführen." - -#: mailjet-widget.php:472 -msgid "Email field is empty" -msgstr "" - -#: mailjet-widget.php:477 -msgid "Missing list id" -msgstr "" - -#: mailjet-widget.php:482 wp-mailjet.php:229 wp-mailjet.php:304 -msgid "Invalid email" -msgstr "Ungültige E-Mail-Adresse" - -#: mailjet-widget.php:492 -#, php-format -msgid "The contact %s is already subscribed" -msgstr "Der Kontakt %s hat sich bereits angemeldet" - -#: mailjet-widget.php:545 wp-mailjet.php:310 -msgid "Confirm your mailing list subscription" -msgstr "Bestätigen Sie Ihre Anmeldung für die Mailing-Liste" - -#: mailjet-widget.php:546 wp-mailjet.php:311 -msgid "Please Confirm Your Subscription To" -msgstr "Bitte bestätigen Sie Ihre Anmeldung für" - -#: mailjet-widget.php:549 wp-mailjet.php:314 -msgid "Click here to confirm" -msgstr "Klicken Sie hier, um zu bestätigen" - -#: mailjet-widget.php:550 wp-mailjet.php:315 -msgid "You may copy/paste this link into your browser:" -msgstr "Sie können diesen Link in Ihren Browser kopieren:" - -#: mailjet-widget.php:552 wp-mailjet.php:317 -msgid "" -"Did not ask to subscribe to this list? Or maybe you have changed your mind? " -"Then simply ignore this email and you will not be subscribed" -msgstr "" -"Sie haben sich nicht bei dieser Liste angemeldet? Oder haben Sie vielleicht " -"Ihre Meinung geändert? Dann ignorieren Sie diese E-Mail einfach, und Sie " -"werden nicht angemeldet" - -#: mailjet-widget.php:553 wp-mailjet.php:318 -msgid "Thanks," -msgstr "Vielen Dank," - -#: mailjet-widget.php:560 wp-mailjet.php:324 -msgid "Subscription Confirmation" -msgstr "Bestätigung für die Anmeldung" - -#: mailjet-widget.php:561 -msgid "" -"Subscription confirmation email sent. Please check your inbox and confirm " -"the subscription." -msgstr "" -"Bestätigungsmail für die Anmeldung wurde gesendet. Bitte überprüfen Sie " -"Ihren Posteingang und bestätigen Sie die Anmeldung." - -#: mailjet-widget.php:575 -msgid "Error. Token verification failed." -msgstr "Fehler. Tokenüberprüfung konnte nicht durchgeführt werden." - -#: mailjet-widget.php:620 wp-mailjet.php:262 -#, php-format -msgid "Thanks for subscribing with %s" -msgstr "Vielen Dank für Ihre Anmeldung bei %s" - -#: mailjet-widget.php:697 -msgid "your@email.com" -msgstr "your@email.com" - -#: view/options-form.php:51 -msgid "Save options" -msgstr "Speicher Optionen" - -#: wp-mailjet.php:76 -msgid "" -"Mailjet plugin requires PHP 5.3 to function properly. Please upgrade PHP" -msgstr "" -"Das Mailjet-Plug-in benötigt PHP 5.3 für einen optimalen Betrieb. Bitte " -"führen Sie ein PHP-Upgrade durch" - -#: wp-mailjet.php:126 -#, php-format -msgid "" -"The mailjet plugin is enabled but your credentials are not set. Please do so now to send your emails through Mailjet Hide Notice" -msgstr "" -"Das Mailjet Plugin is aktiviert aber Ihre E-Mails wurden noch nicht " -"versendet. Bitte klicken Siejetzt " -"versendenum Ihre E-Mails jetzt via Mailjet zu versendenNachricht überspringen" - -#: wp-mailjet.php:181 wp-mailjet.php:199 -msgid "Subscribe to our mailing list" -msgstr "Abonnieren Sie unsere Mailingliste" - -#: wp-mailjet.php:271 -#, php-format -msgid "The contact %s is unsubscribed" -msgstr "Der Kontakt %s wurde abgemeldet" - -#~ msgid "Active" -#~ msgstr "activ" - -#~ msgid "Inactive" -#~ msgstr "inactiv" - -#~ msgid "Subscribe" -#~ msgstr "Abonieren" diff --git a/i18n/wp-mailjet-es_ES.mo b/i18n/wp-mailjet-es_ES.mo deleted file mode 100755 index 54542da4..00000000 Binary files a/i18n/wp-mailjet-es_ES.mo and /dev/null differ diff --git a/i18n/wp-mailjet-es_ES.po b/i18n/wp-mailjet-es_ES.po deleted file mode 100755 index 0d567f18..00000000 --- a/i18n/wp-mailjet-es_ES.po +++ /dev/null @@ -1,511 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Mailjet for wordpress\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-03 17:55+0300\n" -"PO-Revision-Date: 2018-07-03 17:55+0300\n" -"Last-Translator: Mailjet \n" -"Language-Team: Mailjet \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" -"X-Poedit-Basepath: ..\n" -"X-Generator: Poedit 2.0.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-SearchPath-0: .\n" - -#: mailjet-class.php:101 -msgid "Manage your Mailjet lists" -msgstr "Listas Mailjet" - -#: mailjet-class.php:101 -msgid "Lists" -msgstr "Lista" - -#: mailjet-class.php:102 -msgid "Manage your Mailjet campaigns" -msgstr "Gestione sus campañas de Mailjet" - -#: mailjet-class.php:102 mailjet-class.php:166 -msgid "Campaigns" -msgstr "Campañas" - -#: mailjet-class.php:103 -msgid "View your Mailjet statistics" -msgstr "Consulte sus estadísticas de Mailjet" - -#: mailjet-class.php:103 mailjet-class.php:174 -msgid "Statistics" -msgstr "Estadísticas" - -#: mailjet-class.php:182 -msgid "Contacts" -msgstr "Contactos" - -#: mailjet-options.php:46 -msgid "Manage your mailjet lists and settings" -msgstr "Gestione sus listas y ajustes de Mailjet" - -#: mailjet-options.php:55 -msgid "Change your mailjet settings" -msgstr "Parámetros Mailjet" - -#: mailjet-options.php:55 wp-mailjet.php:153 -msgid "Settings" -msgstr "Parámetros" - -#: mailjet-options.php:72 -msgid "Mailjet Settings" -msgstr "Parámetros Mailjet" - -#: mailjet-options.php:75 -msgid "Share the love!" -msgstr "¡Compartir!" - -#: mailjet-options.php:80 -msgid "Improve your email deliverability and monitor action in real time." -msgstr "" -"Mejore la entregabilidad de sus correos electrónicos y supervise las " -"acciones en tiempo real." - -#: mailjet-options.php:80 -msgid "Tweet" -msgstr "Tweet" - -#: mailjet-options.php:88 -#, php-format -msgid "" -"Create " -"your Mailjet account if you don't have any." -msgstr "" -"Crea tu " -"cuenta Mailjet si no tienes una abierta ya" - -#: mailjet-options.php:89 -msgid "" -"Log in with your account through the login form below or visit your account " -"page to get your API keys and set up them below." -msgstr "" -"Conéctese con su cuenta mediante el formulario siguiente o visite la página " -"de su cuenta para obtener sus claves API e instalarlas." - -#: mailjet-options.php:90 -msgid "" -"Create a new " -"list if you don't have one or need a new one." -msgstr "" -"Cree una nueva lista si no tiene o necesita una nueva." - -#: mailjet-options.php:91 -msgid "" -"Add the email collection widget to your sidebar " -"or footer." -msgstr "" -"Añada el widget de suscripción de emails en su " -"barra lateral o footer." - -#: mailjet-options.php:92 -msgid "" -"Create a " -"campaign on mailjet.com to send your newsletter." -msgstr "" -"Cree una campaña en " -"mailjet.com para enviar su newsletter." - -#: mailjet-options.php:93 -msgid "" -"Should you have any questions or encounter any difficulties, please consult " -"our User Guide or contact our technical Support Team" -msgstr "" -"Si tienes alguna pregunta o algún problema, no dudes en consultar nuestra Guía de Usuario o contactar con nuestro equipo de Soporte Técnico." - -#: mailjet-options.php:97 -msgid "Mailjet Plugin" -msgstr "Plugin Mailjet" - -#: mailjet-options.php:106 -msgid "API key" -msgstr "Clave de API" - -#: mailjet-options.php:107 -msgid "Secret key" -msgstr "Clave secreta" - -#: mailjet-options.php:110 -msgid "API Settings" -msgstr "Parámetros de API" - -#: mailjet-options.php:112 -#, php-format -msgid "" -"You can get your API keys from your mailjet account. Please also make " -"sure the sender address %s is active in your account" -msgstr "" -"Puede conseguir sus claves de API desde su cuenta mailjet. Por favor, " -"asegurese que la dirección de remitente %s esté activa en su cuenta" - -#: mailjet-options.php:121 -msgid "Enabled" -msgstr "Activado" - -#: mailjet-options.php:122 -msgid "Enable email through Mailjet" -msgstr "Active email a través de Mailjet" - -#: mailjet-options.php:126 -msgid "SSL Enabled (only with port 465)" -msgstr "SSL activado (sólo para el puerto 465)" - -#: mailjet-options.php:128 -msgid "Enable SSL communication with mailjet.com" -msgstr "Establecer comunicación SSL con mailjet.com" - -#: mailjet-options.php:140 -msgid "Port to use for SMTP communication" -msgstr "Puerto para usar la comunicación SMTP" - -#: mailjet-options.php:142 -msgid "Send test email" -msgstr "Envie un email de prueba" - -#: mailjet-options.php:143 -msgid "Send test email now" -msgstr "Enviar email de prueba ahora" - -#: mailjet-options.php:148 -msgid "Recipient of test email" -msgstr "Destinatario del email de prueba" - -#: mailjet-options.php:152 -msgid "From: email address" -msgstr "De: dirección email" - -#: mailjet-options.php:157 -msgid "From: Name" -msgstr "De:Nombre" - -#: mailjet-options.php:161 -msgid "General Settings" -msgstr "Configuración general" - -#: mailjet-options.php:163 -msgid "" -"Enable or disable the sending of your emails through your Mailjet account" -msgstr "" -"Activar o desactivar el envío de sus emails a través de su cuenta Mailjet" - -#: mailjet-options.php:178 -msgid "" -"Initial sync not yet executed, choose a list and save settings to start it" -msgstr "" -"Sincronización inicial no ejecutada aún. Elige una lista y guarda la " -"configuración para iniciarla." - -#: mailjet-options.php:196 -#, php-format -msgid "" -"Initial users sync is %s! Existing contacts subscribed to %s " -"on %s" -msgstr "" -"La sincronización de usuarios inicial está %s. Los suscriptores " -"actuales suscritos a %s el %s" - -#: mailjet-options.php:201 -msgid "" -"Choose a Mailjet contact list which you would like to subscribe your " -"Wordpress users to." -msgstr "" -"Elige una lista de suscriptores de Mailjet a la que quieras suscribir a tus " -"usuarios de WordPress." - -#: mailjet-options.php:205 -msgid "Disable initial sync" -msgstr "Deshabilitar sincronización inicial" - -#: mailjet-options.php:212 -msgid "Subscribe existing users to this list" -msgstr "Suscribir usuarios actuales a esta lista" - -#: mailjet-options.php:215 -msgid "Disable autosubscribe" -msgstr "Desactivar suscripción automática" - -#: mailjet-options.php:222 -msgid "Auto subscribe new users to this list" -msgstr "Suscribir nuevos usuarios automáticamente a esta lista" - -#: mailjet-options.php:226 -msgid "Subscribe Wordpress users" -msgstr "Suscribir a usuarios de WordPress." - -#: mailjet-options.php:239 -msgid "" -"Comment author sync not yet activated, choose a list and save settings to " -"activate it" -msgstr "" -"Sincronización de autores de comentarios no activada aún. Elige una lista y " -"guarda la configuración para activarla." - -#: mailjet-options.php:256 -#, php-format -msgid "Comment authors sync is %s!" -msgstr "La sincronización de autores de comentarios está %s!" - -#: mailjet-options.php:262 -msgid "" -"This feature adds a \"Subscribe to our mailing list\" checkbox in the " -"\"Leave a reply\" form, so that comment authors can automatically join a " -"contact list of your choice." -msgstr "" -"Esta función añade la casilla \"Suscríbete a nuestra lista de correo\" al " -"formulario \"Escribe una respuesta\" para que los autores de comentarios " -"puedan unirse automáticamente a una lista de suscriptores que elijas." - -#: mailjet-options.php:266 -msgid "Disable comment authors subscription" -msgstr "Deshabilitar la suscripción de autores de comentarios" - -#: mailjet-options.php:273 -msgid "Allow comment authors to subscribe to this list" -msgstr "Permitir que los autores de comentarios se suscriban a esta lista" - -#: mailjet-options.php:276 -msgid "Subscribe comment authors" -msgstr "Sincronización de autores de comentarios" - -#: mailjet-options.php:288 -msgid "Administrator" -msgstr "Administrador" - -#: mailjet-options.php:288 -msgid "User roles able to access the plugin" -msgstr "Los perfiles de usuario permiten acceder al plugin" - -#: mailjet-options.php:289 -msgid "Editor" -msgstr "Editor" - -#: mailjet-options.php:290 -msgid "Author" -msgstr "Autor" - -#: mailjet-options.php:291 -msgid "Contributor" -msgstr "Colaborador" - -#: mailjet-options.php:292 -msgid "Subscriber" -msgstr "Suscriptor" - -#: mailjet-options.php:295 -msgid "Access Settings" -msgstr "Ajustes de acceso" - -#: mailjet-options.php:297 -msgid "" -"Select which WordPress admin user roles (in addition to Administrator) will " -"also have access to the Mailjet Plug-in" -msgstr "" -"Configure los perfiles de usuario que podrán acceder al plugin de Mailjet" - -#: mailjet-options.php:471 -msgid "" -"Please make sure that you are using the correct API key and secret key " -"associated to your mailjet account (from email)." -msgstr "" -"Compruebe que se trata de la clave API y contraseña asociadas a su cuenta de " -"Mailjet (enviadas por correo electrónico)." - -#: mailjet-options.php:486 -msgid "Your test mail from Mailjet" -msgstr "Su email de prueba de Mailjet" - -#: mailjet-options.php:487 -#, php-format -msgid "Your Mailjet configuration is ok!SSL: %s Port: %s" -msgstr "¡Su configuración de Mailjet está bien! SSL: %s Port: %s" - -#: mailjet-options.php:496 -msgid " and your test message was sent." -msgstr " y su mensaje ha sido enviado." - -#: mailjet-options.php:503 mailjet-options.php:505 -msgid "Your settings have been saved successfully" -msgstr "Su configuración ha sido guardada" - -#: mailjet-options.php:507 -msgid "" -"Your settings have been saved, but your port and SSL settings were changed " -"as follows to ensure delivery" -msgstr "" -"Sus parametros han sido guardados, pero su puerto y configuración SSL han " -"sido cambiados como indicado más abajo para asegurar la entrega" - -#: mailjet-options.php:517 -#, php-format -msgid "" -"Please verify that you have entered your API and secret key correctly. If " -"this is the case and you have still this error message, please go to Account " -"API keys (%s) to regenerate a new " -"Secret Key for the plug-in." -msgstr "" -"Por favor, compruebe que ha introducido correctamente su API y su clave " -"secreta. Si es así y sigue apareciendo este mensaje de error, le rogamos que " -"acceda a la sección Account API keys (%s) y vuelva a generar una clave secreta para el plugin." - -#: mailjet-options.php:521 -msgid "There is an error with your settings. please correct and try again" -msgstr "" -"Hay un problema con su configuración. Por favor corríjalo y pruebe de nuevo" - -#: mailjet-widget.php:51 -msgid "Allows your visitors to subscribe to one of your lists" -msgstr "Permite que tus visitantes se suscriban a una de tus listas." - -#: mailjet-widget.php:57 -msgid "Mailjet Subscription widget" -msgstr "Widget de suscripción de Mailjet" - -#: mailjet-widget.php:117 -msgid "" -"You are either v1 user or we could not fetch user contact properties. Please " -"contact our support team to discuss migrating to v3 user where you will have " -"contact properties available. You can still configure a Mailjet subscription " -"widget by clicking on \"Next\" button and complete step2 and step3." -msgstr "" -"Puede que seas usuario de la v1 o no hemos podido recuperar las propiedades " -"de contacto del usuario. Ponte en contacto con nuestro equipo de asistencia técnica " -"para estudiar la posibilidad de migrar a la v3, donde dispondrás de " -"propiedades de contacto. En cualquier caso, puedes configurar un widget de " -"suscripción de Mailjet si haces clic en \"Siguiente\" y completas los pasos " -"2 y 3." - -#: mailjet-widget.php:472 -msgid "Email field is empty" -msgstr "" - -#: mailjet-widget.php:477 -msgid "Missing list id" -msgstr "" - -#: mailjet-widget.php:482 wp-mailjet.php:229 wp-mailjet.php:304 -msgid "Invalid email" -msgstr "Email no válido" - -#: mailjet-widget.php:492 -#, php-format -msgid "The contact %s is already subscribed" -msgstr "El contacto %s ya está suscrito" - -#: mailjet-widget.php:545 wp-mailjet.php:310 -msgid "Confirm your mailing list subscription" -msgstr "Confirma tu suscripción a la lista de email" - -#: mailjet-widget.php:546 wp-mailjet.php:311 -msgid "Please Confirm Your Subscription To" -msgstr "Confirma tu suscripción a" - -#: mailjet-widget.php:549 wp-mailjet.php:314 -msgid "Click here to confirm" -msgstr "Haz clic aquí para confirmar" - -#: mailjet-widget.php:550 wp-mailjet.php:315 -msgid "You may copy/paste this link into your browser:" -msgstr "Puedes copiar y pegar este enlace en el navegador:" - -#: mailjet-widget.php:552 wp-mailjet.php:317 -msgid "" -"Did not ask to subscribe to this list? Or maybe you have changed your mind? " -"Then simply ignore this email and you will not be subscribed" -msgstr "" -"¿No te suscribiste a esta lista? ¿O quizá has cambiado de opinión? En ese " -"caso, basta con que ignores este email." - -#: mailjet-widget.php:553 wp-mailjet.php:318 -msgid "Thanks," -msgstr "Gracias." - -#: mailjet-widget.php:560 wp-mailjet.php:324 -msgid "Subscription Confirmation" -msgstr "Confirmación de suscripción" - -#: mailjet-widget.php:561 -msgid "" -"Subscription confirmation email sent. Please check your inbox and confirm " -"the subscription." -msgstr "" -"Se ha enviado un email de confirmación de suscripción. Consulta tu bandeja " -"de entrada y confirma la suscripción." - -#: mailjet-widget.php:575 -msgid "Error. Token verification failed." -msgstr "Error. Ha fallado la verificación del token." - -#: mailjet-widget.php:620 wp-mailjet.php:262 -#, php-format -msgid "Thanks for subscribing with %s" -msgstr "Gracias por suscribirte a %s" - -#: mailjet-widget.php:697 -msgid "your@email.com" -msgstr "su@email.com" - -#: view/options-form.php:51 -msgid "Save options" -msgstr "Guardar opciones" - -#: wp-mailjet.php:76 -msgid "" -"Mailjet plugin requires PHP 5.3 to function properly. Please upgrade PHP" -msgstr "" -"El plug-in de Mailjet requiere PHP 5.3 para que funcione correctamente. " -"Actualiza la versión de PHP" - -#: wp-mailjet.php:126 -#, php-format -msgid "" -"The mailjet plugin is enabled but your credentials are not set. Please do so now to send your emails through Mailjet Hide Notice" -msgstr "" -"El plugin de Mailjet está activado pero sus credenciales no están " -"establecidas. Por favor hágalo ahora para enviar sus emails a " -"través de Mailjet Quitar notificación" - -#: wp-mailjet.php:181 wp-mailjet.php:199 -msgid "Subscribe to our mailing list" -msgstr "Suscríbete a nuestra lista de correo" - -#: wp-mailjet.php:271 -#, php-format -msgid "The contact %s is unsubscribed" -msgstr "Se ha cancelado la suscripción de %s" - -#~ msgid "Active" -#~ msgstr "activa" - -#~ msgid "Inactive" -#~ msgstr "inactiva" - -#~ msgid "Subscribe" -#~ msgstr "Registrarse" diff --git a/i18n/wp-mailjet-fr_FR.mo b/i18n/wp-mailjet-fr_FR.mo deleted file mode 100755 index 2b0807ec..00000000 Binary files a/i18n/wp-mailjet-fr_FR.mo and /dev/null differ diff --git a/i18n/wp-mailjet-fr_FR.po b/i18n/wp-mailjet-fr_FR.po deleted file mode 100755 index 3f5f4801..00000000 --- a/i18n/wp-mailjet-fr_FR.po +++ /dev/null @@ -1,524 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Mailjet for wordpress\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-04 11:39+0300\n" -"PO-Revision-Date: 2018-07-04 11:40+0300\n" -"Last-Translator: Mailjet \n" -"Language-Team: Mailjet \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" -"X-Poedit-Basepath: ..\n" -"X-Generator: Poedit 2.0.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-SearchPath-0: .\n" - -#: mailjet-class.php:101 -msgid "Manage your Mailjet lists" -msgstr "Gérer vos listes Mailjet" - -#: mailjet-class.php:101 -msgid "Lists" -msgstr "Liste" - -#: mailjet-class.php:102 -msgid "Manage your Mailjet campaigns" -msgstr "Gérez vos campagnes Mailjet" - -#: mailjet-class.php:102 mailjet-class.php:166 -msgid "Campaigns" -msgstr "Campagnes" - -#: mailjet-class.php:103 -msgid "View your Mailjet statistics" -msgstr "Consultez vos statistiques Mailjet" - -#: mailjet-class.php:103 mailjet-class.php:174 -msgid "Statistics" -msgstr "Statistiques" - -#: mailjet-class.php:182 -msgid "Contacts" -msgstr "Contacts" - -#: mailjet-options.php:46 -msgid "Manage your mailjet lists and settings" -msgstr "Gérez vos listes et paramètres Mailjet" - -#: mailjet-options.php:55 -msgid "Change your mailjet settings" -msgstr "Paramètres Mailjet" - -#: mailjet-options.php:55 wp-mailjet.php:153 -msgid "Settings" -msgstr "Paramètres" - -#: mailjet-options.php:72 -msgid "Mailjet Settings" -msgstr "Paramètres Mailjet" - -#: mailjet-options.php:75 -msgid "Share the love!" -msgstr "Partagez!" - -#: mailjet-options.php:80 -msgid "Improve your email deliverability and monitor action in real time." -msgstr "Améliorez votre délivrabilité et suivez vos emails en temps réel." - -#: mailjet-options.php:80 -msgid "Tweet" -msgstr "Tweeter" - -#: mailjet-options.php:88 -#, php-format -msgid "" -"Create " -"your Mailjet account if you don't have any." -msgstr "" -"Si vous ne l'avez pas encore fait, créez votre compte Mailjet." - -#: mailjet-options.php:89 -msgid "" -"Log in with your account through the login form below or visit your account " -"page to get your API keys and set up them below." -msgstr "" -"Connectez-vous via le formulaire de connexion ci-dessous ou rendez-vous sur " -"votre page de compte pour obtenir vos clés d'API et les installer ci-" -"dessous." - -#: mailjet-options.php:90 -msgid "" -"Create a new " -"list if you don't have one or need a new one." -msgstr "" -"Créez une nouvelle " -"liste si vous n'en avez pas ou que vous en voulez en ajouter une." - -#: mailjet-options.php:91 -msgid "" -"Add the email collection widget to your sidebar " -"or footer." -msgstr "" -"Ajoutez le widget de collecte d'adresses emails " -"dans votre barre latérale, ou votre footer." - -#: mailjet-options.php:92 -msgid "" -"Create a " -"campaign on mailjet.com to send your newsletter." -msgstr "" -"Créer une campagne " -"sur mailjet.com ou envoyer une newsletter." - -#: mailjet-options.php:93 -msgid "" -"Should you have any questions or encounter any difficulties, please consult " -"our User Guide or contact our technical Support Team" -msgstr "" -"Si vous avez des questions ou rencontrez des difficultés, merci de consulter " -"notre manuel d'utilisation ou bien de contacter notre équipe support." - -#: mailjet-options.php:97 -msgid "Mailjet Plugin" -msgstr "Plugin Mailjet" - -#: mailjet-options.php:106 -msgid "API key" -msgstr "Clé API" - -#: mailjet-options.php:107 -msgid "Secret key" -msgstr "Clé secrète" - -#: mailjet-options.php:110 -msgid "API Settings" -msgstr "Paramètres API" - -#: mailjet-options.php:112 -#, php-format -msgid "" -"You can get your API keys from your mailjet account. Please also make " -"sure the sender address %s is active in your account" -msgstr "" -"Vous pouvez obtenir vos clés API depuis votre compte Mailjet. Assurez-vous que " -"l'adresse d'envoyeur %s est bien activée dans votre compte" - -#: mailjet-options.php:121 -msgid "Enabled" -msgstr "Activé" - -#: mailjet-options.php:122 -msgid "Enable email through Mailjet" -msgstr "Activer l'email via Mailjet" - -#: mailjet-options.php:126 -msgid "SSL Enabled (only with port 465)" -msgstr "SSL activé (uniquement avec le port 465)" - -#: mailjet-options.php:128 -msgid "Enable SSL communication with mailjet.com" -msgstr "Activer SSL lors des communications avec mailjet.com" - -#: mailjet-options.php:140 -msgid "Port to use for SMTP communication" -msgstr "Port utilisé pour la communication SMTP" - -#: mailjet-options.php:142 -msgid "Send test email" -msgstr "Envoyer un email test" - -#: mailjet-options.php:143 -msgid "Send test email now" -msgstr "Envoyer un email test maintenant" - -#: mailjet-options.php:148 -msgid "Recipient of test email" -msgstr "Destinataire de l'email test" - -#: mailjet-options.php:152 -msgid "From: email address" -msgstr "De : adresse email" - -#: mailjet-options.php:157 -msgid "From: Name" -msgstr "De : Nom" - -#: mailjet-options.php:161 -msgid "General Settings" -msgstr "Paramètres généraux" - -#: mailjet-options.php:163 -msgid "" -"Enable or disable the sending of your emails through your Mailjet account" -msgstr "Activer ou désactiver l'envoi de vos emails via votre compte Mailjet" - -#: mailjet-options.php:178 -msgid "" -"Initial sync not yet executed, choose a list and save settings to start it" -msgstr "" -"La synchronisation initiale n'est pas encore exécutée ; choisissez une liste " -"et enregistrez les paramètres pour la lancer" - -#: mailjet-options.php:196 -#, php-format -msgid "" -"Initial users sync is %s! Existing contacts subscribed to %s " -"on %s" -msgstr "" -"La synchronisation initiale des utilisateurs est %s! Les contacts " -"existants ont été inscrits à %s le %s" - -#: mailjet-options.php:201 -msgid "" -"Choose a Mailjet contact list which you would like to subscribe your " -"Wordpress users to." -msgstr "" -"Choisissez une liste de contacts Mailjet à laquelle vous souhaitez inscrire " -"vos utilisateurs WordPress." - -#: mailjet-options.php:205 -msgid "Disable initial sync" -msgstr "Désactiver la synchronisation initiale" - -#: mailjet-options.php:212 -msgid "Subscribe existing users to this list" -msgstr "Inscrire les utilisateurs existants à cette liste" - -#: mailjet-options.php:215 -msgid "Disable autosubscribe" -msgstr "Désactiver l'inscription auto" - -#: mailjet-options.php:222 -msgid "Auto subscribe new users to this list" -msgstr "Inscrire automatiquement les nouveaux utilisateurs à cette liste" - -#: mailjet-options.php:226 -msgid "Subscribe Wordpress users" -msgstr "Inscrire les utilisateurs WordPress" - -#: mailjet-options.php:239 -msgid "" -"Comment author sync not yet activated, choose a list and save settings to " -"activate it" -msgstr "" -"La synchronisation des auteurs de commentaires n'est pas encore activée ; " -"choisissez une liste et enregistrez les paramètres pour l'activer" - -#: mailjet-options.php:256 -#, php-format -msgid "Comment authors sync is %s!" -msgstr "La synchronisation des auteurs de commentaires est %s!" - -#: mailjet-options.php:262 -msgid "" -"This feature adds a \"Subscribe to our mailing list\" checkbox in the " -"\"Leave a reply\" form, so that comment authors can automatically join a " -"contact list of your choice." -msgstr "" -"Cette fonctionnalité permet d'ajouter une case à cocher \"Inscrire à notre " -"liste de diffusion\" dans le formulaire \"Laisser un commentaire\" afin que " -"les auteurs de commentaires puissent rejoindre automatiquement la liste de " -"contacts de votre choix." - -#: mailjet-options.php:266 -msgid "Disable comment authors subscription" -msgstr "Désactiver l'inscription des auteurs de commentaires" - -#: mailjet-options.php:273 -msgid "Allow comment authors to subscribe to this list" -msgstr "Autoriser les auteurs de commentaires à s'inscrire à cette liste" - -#: mailjet-options.php:276 -msgid "Subscribe comment authors" -msgstr "Synchronisation des auteurs de commentaires" - -#: mailjet-options.php:288 -msgid "Administrator" -msgstr "Administrateur" - -#: mailjet-options.php:288 -msgid "User roles able to access the plugin" -msgstr "Rôles d'utilisateur ayant accès au plug-in" - -#: mailjet-options.php:289 -msgid "Editor" -msgstr "Editeur" - -#: mailjet-options.php:290 -msgid "Author" -msgstr "Auteur" - -#: mailjet-options.php:291 -msgid "Contributor" -msgstr "Contributeur" - -#: mailjet-options.php:292 -msgid "Subscriber" -msgstr "Abonné" - -#: mailjet-options.php:295 -msgid "Access Settings" -msgstr "Paramètres d'accès" - -#: mailjet-options.php:297 -msgid "" -"Select which WordPress admin user roles (in addition to Administrator) will " -"also have access to the Mailjet Plug-in" -msgstr "" -"Spécifiez les rôles d'utilisateur qui peuvent accéder au plug-in Mailjet" - -#: mailjet-options.php:471 -msgid "" -"Please make sure that you are using the correct API key and secret key " -"associated to your mailjet account (from email)." -msgstr "" -"Veillez à utiliser la bonne clé d'API et la clé secrète associée à votre " -"compte Mailjet (qui vous a été envoyée par e-mail)." - -#: mailjet-options.php:486 -msgid "Your test mail from Mailjet" -msgstr "Votre email test depuis Mailjet" - -#: mailjet-options.php:487 -#, php-format -msgid "Your Mailjet configuration is ok!SSL: %s Port: %s" -msgstr "Votre configuration Mailjet est OK !SSL: %s Port: %s" - -#: mailjet-options.php:496 -msgid " and your test message was sent." -msgstr " et votre message test a été envoyé." - -#: mailjet-options.php:503 mailjet-options.php:505 -msgid "Your settings have been saved successfully" -msgstr "Vos paramètres ont été sauvegardés avec succès" - -#: mailjet-options.php:507 -msgid "" -"Your settings have been saved, but your port and SSL settings were changed " -"as follows to ensure delivery" -msgstr "" -"Vos paramètres on été changés, mais vos options SSL on été modifiées pour " -"garantir le fonctionnement du plugin." - -#: mailjet-options.php:517 -#, php-format -msgid "" -"Please verify that you have entered your API and secret key correctly. If " -"this is the case and you have still this error message, please go to Account " -"API keys (%s) to regenerate a new " -"Secret Key for the plug-in." -msgstr "" -"Merci de vérifier que vous avez correctement saisi votre clé d'API et votre " -"clé secrète. Si vous obtenez toujours ce message d'erreur après " -"vérification, rendez-vous dans la section Account API keys (« Clés d'API de " -"compte ») (%s) pour générer un nouvelle " -"clé secrète pour le plug-in." - -#: mailjet-options.php:521 -msgid "There is an error with your settings. please correct and try again" -msgstr "Il y a une erreur avec vos paramètres. Merci de corriger et réessayer" - -#: mailjet-widget.php:51 -msgid "Allows your visitors to subscribe to one of your lists" -msgstr "Permet à vos visiteurs de s'abonner à l'une de vos listes" - -#: mailjet-widget.php:57 -msgid "Mailjet Subscription widget" -msgstr "Widget d'abonnement Mailjet" - -#: mailjet-widget.php:117 -msgid "" -"You are either v1 user or we could not fetch user contact properties. Please " -"contact our support team to discuss migrating to v3 user where you will have " -"contact properties available. You can still configure a Mailjet subscription " -"widget by clicking on \"Next\" button and complete step2 and step3." -msgstr "" -"Vous êtes un utilisateur v1 ou nous n'avons trouvé aucune propriété de " -"contact. Veuillez contacter notre équipe de support pour devenir un utilisateur " -"v3 et disposer de propriétés de contact. Vous pouvez tout de même configurer " -"un widget d'abonnement Mailjet en cliquant sur le bouton « Suivant » et en " -"effectuant les étapes 2 et 3." - -#: mailjet-widget.php:472 -msgid "Email field is empty" -msgstr "Le champ e-mail est vide." - -#: mailjet-widget.php:477 -msgid "Missing list id" -msgstr "Missing list id" - -#: mailjet-widget.php:482 wp-mailjet.php:229 wp-mailjet.php:304 -msgid "Invalid email" -msgstr "Adresse email invalide" - -#: mailjet-widget.php:492 -#, php-format -msgid "The contact %s is already subscribed" -msgstr "Le contact %s est déjà abonné" - -#: mailjet-widget.php:519 -msgid "" -"You have entered a contact property with wrong data type, for example a " -"string instead of a number." -msgstr "" -"Vous avez entré une propriété de contact avec un type de données incorrect, " -"par exemple une chaîne au lieu d'un nombre." - -#: mailjet-widget.php:528 -msgid "" -"You have entered a Datetime contact property with Invalid date value. Valid " -"format for date time property is \"dd-mm-YYYY\" or \"dd/mm/YYYY\"." -msgstr "" - -#: mailjet-widget.php:542 wp-mailjet.php:310 -msgid "Confirm your mailing list subscription" -msgstr "Confirmez votre inscription à la liste de diffusion" - -#: mailjet-widget.php:543 wp-mailjet.php:311 -msgid "Please Confirm Your Subscription To" -msgstr "Veuillez confirmer votre inscription à" - -#: mailjet-widget.php:546 wp-mailjet.php:314 -msgid "Click here to confirm" -msgstr "Cliquez ici pour confirmer" - -#: mailjet-widget.php:547 wp-mailjet.php:315 -msgid "You may copy/paste this link into your browser:" -msgstr "Vous pouvez copier ce lien et le coller dans votre navigateur :" - -#: mailjet-widget.php:549 wp-mailjet.php:317 -msgid "" -"Did not ask to subscribe to this list? Or maybe you have changed your mind? " -"Then simply ignore this email and you will not be subscribed" -msgstr "" -"Si vous n'avez pas effectué de demande d'inscription à cette liste ou avez " -"changé d'avis, veuillez ignorer cet email." - -#: mailjet-widget.php:550 wp-mailjet.php:318 -msgid "Thanks," -msgstr "Merci," - -#: mailjet-widget.php:557 wp-mailjet.php:324 -msgid "Subscription Confirmation" -msgstr "Confirmation d'inscription" - -#: mailjet-widget.php:558 -msgid "" -"Subscription confirmation email sent. Please check your inbox and confirm " -"the subscription." -msgstr "" -"Un email de confirmation d'inscription a été envoyé. Veuillez vérifier votre " -"boîte de réception et confirmer votre inscription." - -#: mailjet-widget.php:572 -msgid "Error. Token verification failed." -msgstr "Erreur. Échec de vérification du jeton." - -#: mailjet-widget.php:617 wp-mailjet.php:262 -#, php-format -msgid "Thanks for subscribing with %s" -msgstr "Merci d'avoir choisi %s pour votre abonnement" - -#: mailjet-widget.php:694 -msgid "your@email.com" -msgstr "your@email.com" - -#: view/options-form.php:51 -msgid "Save options" -msgstr "Sauvegarder les options" - -#: wp-mailjet.php:76 -msgid "" -"Mailjet plugin requires PHP 5.3 to function properly. Please upgrade PHP" -msgstr "" -"Le plugin Mailjet nécessite PHP 5.3 pour fonctionner correctement. Veuillez " -"effectuer une mise à niveau de PHP" - -#: wp-mailjet.php:126 -#, php-format -msgid "" -"The mailjet plugin is enabled but your credentials are not set. Please do so now to send your emails through Mailjet Hide Notice" -msgstr "" -"Le plugin Mailjet est activé mais vos identifiants ne sont pas configurés. " -"Pour envoyer vos emails via Mailjet, pourriez-vous faire " -"cela dès maintenant ? Cacher ce message" - -#: wp-mailjet.php:181 wp-mailjet.php:199 -msgid "Subscribe to our mailing list" -msgstr "Abonnez-vous à notre liste de diffusion" - -#: wp-mailjet.php:271 -#, php-format -msgid "The contact %s is unsubscribed" -msgstr "Le contact %s est désabonné" - -#~ msgid "Active" -#~ msgstr "active" - -#~ msgid "Inactive" -#~ msgstr "inactive" - -#~ msgid "Subscribe" -#~ msgstr "S'abonner" diff --git a/i18n/wp-mailjet-subscription-widget-de_DE.mo b/i18n/wp-mailjet-subscription-widget-de_DE.mo deleted file mode 100644 index b2f6d579..00000000 Binary files a/i18n/wp-mailjet-subscription-widget-de_DE.mo and /dev/null differ diff --git a/i18n/wp-mailjet-subscription-widget-de_DE.po b/i18n/wp-mailjet-subscription-widget-de_DE.po deleted file mode 100644 index a6d78c23..00000000 --- a/i18n/wp-mailjet-subscription-widget-de_DE.po +++ /dev/null @@ -1,72 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: de_DE\n" -"X-Generator: Poedit 2.0.4\n" - -#: mailjet-widget.php -msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." -msgstr "Bestätigungsmail für die Anmeldung wurde gesendet. Bitte überprüfen Sie Ihren Posteingang und bestätigen Sie die Anmeldung." - -#: mailjet-widget.php -msgid "Confirm your mailing list subscription" -msgstr "Bitte bestätigen Sie Ihr Abonnement" - -#: mailjet-widget.php -msgid "Email field is empty" -msgstr "Das Feld E-Mail-Adresse ist leer" - -#: mailjet-widget.php -msgid "your@email.com" -msgstr "deine@email.com" - -#: mailjet-widget.php -msgid "Error. Token verification failed." -msgstr "Fehler.Tokenüberprüfung konnte nicht durchgeführt werden." - -#: mailjet-widget.php -msgid "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." -msgstr "Es tut uns leid %s Wir konnten die Anmeldung dieses Mal nicht ausführen" - -#: mailjet-widget.php -msgid "The contact %s is already subscribed" -msgstr "Der Kontakt %s ist bereits angemeldet" - -#: mailjet-widget.php -msgid "Thanks for subscribing with %s" -msgstr "Vielen Dank für Ihre Anmeldung bei %s" - -#: mailjet-widget.php -msgid "You have entered a contact property with wrong data type, for example a string instead of a number." -msgstr "Sie haben eine Kontakteigenschaft mit falschem Datentyp eingegeben, z.B. eine Zeichenkette statt einer Nummer." - -#: mailjet-widget.php -msgid "Subscription Confirmation" -msgstr "Bestätigung für die Anmeldung" - -#: mailjet-widget.php -msgid "Please Confirm Your Subscription To" -msgstr "Um den Newsletter von %s zu erhalten, bestätigen Sie bitte Ihr Abonnement, indem Sie auf den folgenden Button klicken:" - -#: mailjet-widget.php -msgid "Click here to confirm" -msgstr "Ja, ich möchte diesen Newsletter abonnieren" - -#: mailjet-widget.php -msgid "You may copy/paste this link into your browser:" -msgstr "Sie können diesen Link in Ihren Browser kopieren:" - -#: mailjet-widget.php -msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" -msgstr "Wenn Sie diese E-Mail versehentlich erhalten haben oder sich nicht mehr anmelden möchten, ignorieren Sie diese E-Mail einfach." - -#: mailjet-widget.php -msgid "Thanks," -msgstr "Vielen Dank," diff --git a/i18n/wp-mailjet-subscription-widget-en_EN.mo b/i18n/wp-mailjet-subscription-widget-en_EN.mo deleted file mode 100644 index d429bc70..00000000 Binary files a/i18n/wp-mailjet-subscription-widget-en_EN.mo and /dev/null differ diff --git a/i18n/wp-mailjet-subscription-widget-en_EN.po b/i18n/wp-mailjet-subscription-widget-en_EN.po deleted file mode 100644 index 2084ed10..00000000 --- a/i18n/wp-mailjet-subscription-widget-en_EN.po +++ /dev/null @@ -1,73 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en_US\n" -"X-Generator: Poedit 2.0.4\n" -"X-Poedit-SourceCharset: UTF-8\n" - -#: mailjet-widget.php -msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." -msgstr "Subscription confirmation email sent. Please check your inbox and confirm the subscription." - -#: mailjet-widget.php -msgid "Confirm your mailing list subscription" -msgstr "Please confirm your subscription" - -#: mailjet-widget.php -msgid "Email field is empty" -msgstr "Email field is empty" - -#: mailjet-widget.php -msgid "your@email.com" -msgstr "your@email.com" - -#: mailjet-widget.php -msgid "Error. Token verification failed." -msgstr "Error. Token verification failed." - -#: mailjet-widget.php -msgid "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." -msgstr "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." - -#: mailjet-widget.php -msgid "The contact %s is already subscribed" -msgstr "The contact %s is already subscribed" - -#: mailjet-widget.php -msgid "Thanks for subscribing with %s" -msgstr "Thanks for subscribing with %s" - -#: mailjet-widget.php -msgid "You have entered a contact property with wrong data type, for example a string instead of a number." -msgstr "You have entered a contact property with wrong data type, for example a string instead of a number." - -#: mailjet-widget.php -msgid "Subscription Confirmation" -msgstr "Subscription Confirmation" - -#: mailjet-widget.php -msgid "Please Confirm Your Subscription To" -msgstr "To receive newsletters from: %s, please confirm your subscription by clicking the following button." - -#: mailjet-widget.php -msgid "Click here to confirm" -msgstr "Yes, subscribe me to this list" - -#: mailjet-widget.php -msgid "You may copy/paste this link into your browser:" -msgstr "You may copy/paste this link into your browser:" - -#: mailjet-widget.php -msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" -msgstr "If you received this email by mistake or don\\'t wish to subscribe anymore, simply ignore this email." - -#: mailjet-widget.php -msgid "Thanks," -msgstr "Thanks," diff --git a/i18n/wp-mailjet-subscription-widget-en_US.mo b/i18n/wp-mailjet-subscription-widget-en_US.mo deleted file mode 100644 index d429bc70..00000000 Binary files a/i18n/wp-mailjet-subscription-widget-en_US.mo and /dev/null differ diff --git a/i18n/wp-mailjet-subscription-widget-en_US.po b/i18n/wp-mailjet-subscription-widget-en_US.po deleted file mode 100644 index 2084ed10..00000000 --- a/i18n/wp-mailjet-subscription-widget-en_US.po +++ /dev/null @@ -1,73 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en_US\n" -"X-Generator: Poedit 2.0.4\n" -"X-Poedit-SourceCharset: UTF-8\n" - -#: mailjet-widget.php -msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." -msgstr "Subscription confirmation email sent. Please check your inbox and confirm the subscription." - -#: mailjet-widget.php -msgid "Confirm your mailing list subscription" -msgstr "Please confirm your subscription" - -#: mailjet-widget.php -msgid "Email field is empty" -msgstr "Email field is empty" - -#: mailjet-widget.php -msgid "your@email.com" -msgstr "your@email.com" - -#: mailjet-widget.php -msgid "Error. Token verification failed." -msgstr "Error. Token verification failed." - -#: mailjet-widget.php -msgid "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." -msgstr "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." - -#: mailjet-widget.php -msgid "The contact %s is already subscribed" -msgstr "The contact %s is already subscribed" - -#: mailjet-widget.php -msgid "Thanks for subscribing with %s" -msgstr "Thanks for subscribing with %s" - -#: mailjet-widget.php -msgid "You have entered a contact property with wrong data type, for example a string instead of a number." -msgstr "You have entered a contact property with wrong data type, for example a string instead of a number." - -#: mailjet-widget.php -msgid "Subscription Confirmation" -msgstr "Subscription Confirmation" - -#: mailjet-widget.php -msgid "Please Confirm Your Subscription To" -msgstr "To receive newsletters from: %s, please confirm your subscription by clicking the following button." - -#: mailjet-widget.php -msgid "Click here to confirm" -msgstr "Yes, subscribe me to this list" - -#: mailjet-widget.php -msgid "You may copy/paste this link into your browser:" -msgstr "You may copy/paste this link into your browser:" - -#: mailjet-widget.php -msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" -msgstr "If you received this email by mistake or don\\'t wish to subscribe anymore, simply ignore this email." - -#: mailjet-widget.php -msgid "Thanks," -msgstr "Thanks," diff --git a/i18n/wp-mailjet-subscription-widget-es_ES.mo b/i18n/wp-mailjet-subscription-widget-es_ES.mo deleted file mode 100644 index f49699ed..00000000 Binary files a/i18n/wp-mailjet-subscription-widget-es_ES.mo and /dev/null differ diff --git a/i18n/wp-mailjet-subscription-widget-es_ES.po b/i18n/wp-mailjet-subscription-widget-es_ES.po deleted file mode 100644 index d1938ad7..00000000 --- a/i18n/wp-mailjet-subscription-widget-es_ES.po +++ /dev/null @@ -1,72 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: es_ES\n" -"X-Generator: Poedit 2.0.4\n" - -#: mailjet-widget.php -msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." -msgstr "Se ha enviado un email de confirmación de suscripción. Consulta tu bandeja de entrada y confirma la suscripción." - -#: mailjet-widget.php -msgid "Confirm your mailing list subscription" -msgstr "Por favor, confirme su suscripción" - -#: mailjet-widget.php -msgid "Email field is empty" -msgstr "El campo e-mail está vacío" - -#: mailjet-widget.php -msgid "your@email.com" -msgstr "su@email.com" - -#: mailjet-widget.php -msgid "Error. Token verification failed." -msgstr "Error. Ha fallado la verificación del token." - -#: mailjet-widget.php -msgid "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." -msgstr "Lo sentimos %s. No hemos podido suscribirle." - -#: mailjet-widget.php -msgid "The contact %s is already subscribed" -msgstr "El contacto %s ya está suscrito" - -#: mailjet-widget.php -msgid "Thanks for subscribing with %s" -msgstr "Gracias por suscribirse a %s" - -#: mailjet-widget.php -msgid "You have entered a contact property with wrong data type, for example a string instead of a number." -msgstr "Has introducido una propiedad de contacto con el tipo de dato incorrecto, por ejemplo una cadena de caracteres en vez de un número." - -#: mailjet-widget.php -msgid "Subscription Confirmation" -msgstr "Confirmación de suscripción" - -#: mailjet-widget.php -msgid "Please Confirm Your Subscription To" -msgstr "Para recibir boletines de: %s, por favor confirme su suscripción haciendo clic en el siguiente botón:" - -#: mailjet-widget.php -msgid "Click here to confirm" -msgstr "Sí, suscribirme a esta lista." - -#: mailjet-widget.php -msgid "You may copy/paste this link into your browser:" -msgstr "Puedes copiar y pegar este enlace en el navegador:" - -#: mailjet-widget.php -msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" -msgstr "Si usted recibió este correo electrónico por error o no desea suscribirse más, simplemente ignore este correo electrónico." - -#: mailjet-widget.php -msgid "Thanks," -msgstr "Gracias." diff --git a/i18n/wp-mailjet-subscription-widget-fr_FR.mo b/i18n/wp-mailjet-subscription-widget-fr_FR.mo deleted file mode 100644 index 139f3733..00000000 Binary files a/i18n/wp-mailjet-subscription-widget-fr_FR.mo and /dev/null differ diff --git a/i18n/wp-mailjet-subscription-widget-fr_FR.po b/i18n/wp-mailjet-subscription-widget-fr_FR.po deleted file mode 100644 index ca4af445..00000000 --- a/i18n/wp-mailjet-subscription-widget-fr_FR.po +++ /dev/null @@ -1,72 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fr_FR\n" -"X-Generator: Poedit 2.0.4\n" - -#: mailjet-widget.php -msgid "Subscription Confirmation" -msgstr "Confirmation abonnement" - -#: mailjet-widget.php -msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." -msgstr "Un email de confirmation d'inscription a été envoyé. Veuillez vérifier votre boîte de réception et confirmer votre inscription." - -#: mailjet-widget.php -msgid "Email field is empty" -msgstr "Le champ e-mail est vide" - -#: mailjet-widget.php -msgid "your@email.com" -msgstr "votre@email.com" - -#: mailjet-widget.php -msgid "Error. Token verification failed." -msgstr "Erreur. Échec de vérification du jeton." - -#: mailjet-widget.php -msgid "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." -msgstr "%s, l'abonnement est malheureusement impossible pour le moment" - -#: mailjet-widget.php -msgid "The contact %s is already subscribed" -msgstr "Le contact %s est déjà abonné" - -#: mailjet-widget.php -msgid "Thanks for subscribing with %s" -msgstr "Merci d'avoir choisi %s pour votre abonnement" - -#: mailjet-widget.php -msgid "You have entered a contact property with wrong data type, for example a string instead of a number." -msgstr "Vous avez entré une propriété de contact avec un type de données incorrect, par exemple une chaîne au lieu d'un nombre." - -#: mailjet-widget.php -msgid "Confirm your mailing list subscription" -msgstr "Veuillez confirmer votre abonnement" - -#: mailjet-widget.php -msgid "Please Confirm Your Subscription To" -msgstr "Pour recevoir la newsletter de %s, veuillez confirmer votre abonnement en cliquant sur le bouton suivant :" - -#: mailjet-widget.php -msgid "Click here to confirm" -msgstr "Oui, abonnez-moi à cette liste" - -#: mailjet-widget.php -msgid "You may copy/paste this link into your browser:" -msgstr "Si le bouton ne fonctionne pas, veuillez copier/coller l'URL suivante dans votre navigateur :" - -#: mailjet-widget.php -msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" -msgstr "Si vous recevez cet email par erreur ou si vous ne souhaitez plus vous abonner, ignorer simplement cet email." - -#: mailjet-widget.php -msgid "Thanks," -msgstr "Merci," diff --git a/i18n/wp-mailjet-subscription-widget.mo b/i18n/wp-mailjet-subscription-widget.mo deleted file mode 100644 index d429bc70..00000000 Binary files a/i18n/wp-mailjet-subscription-widget.mo and /dev/null differ diff --git a/i18n/wp-mailjet-subscription-widget.po b/i18n/wp-mailjet-subscription-widget.po deleted file mode 100644 index 2084ed10..00000000 --- a/i18n/wp-mailjet-subscription-widget.po +++ /dev/null @@ -1,73 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en_US\n" -"X-Generator: Poedit 2.0.4\n" -"X-Poedit-SourceCharset: UTF-8\n" - -#: mailjet-widget.php -msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." -msgstr "Subscription confirmation email sent. Please check your inbox and confirm the subscription." - -#: mailjet-widget.php -msgid "Confirm your mailing list subscription" -msgstr "Please confirm your subscription" - -#: mailjet-widget.php -msgid "Email field is empty" -msgstr "Email field is empty" - -#: mailjet-widget.php -msgid "your@email.com" -msgstr "your@email.com" - -#: mailjet-widget.php -msgid "Error. Token verification failed." -msgstr "Error. Token verification failed." - -#: mailjet-widget.php -msgid "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." -msgstr "Sorry %s we were not able to complete your subscription because it appears that you are already subscribed." - -#: mailjet-widget.php -msgid "The contact %s is already subscribed" -msgstr "The contact %s is already subscribed" - -#: mailjet-widget.php -msgid "Thanks for subscribing with %s" -msgstr "Thanks for subscribing with %s" - -#: mailjet-widget.php -msgid "You have entered a contact property with wrong data type, for example a string instead of a number." -msgstr "You have entered a contact property with wrong data type, for example a string instead of a number." - -#: mailjet-widget.php -msgid "Subscription Confirmation" -msgstr "Subscription Confirmation" - -#: mailjet-widget.php -msgid "Please Confirm Your Subscription To" -msgstr "To receive newsletters from: %s, please confirm your subscription by clicking the following button." - -#: mailjet-widget.php -msgid "Click here to confirm" -msgstr "Yes, subscribe me to this list" - -#: mailjet-widget.php -msgid "You may copy/paste this link into your browser:" -msgstr "You may copy/paste this link into your browser:" - -#: mailjet-widget.php -msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" -msgstr "If you received this email by mistake or don\\'t wish to subscribe anymore, simply ignore this email." - -#: mailjet-widget.php -msgid "Thanks," -msgstr "Thanks," diff --git a/i18n/wp-mailjet.mo b/i18n/wp-mailjet.mo deleted file mode 100755 index c809c46f..00000000 Binary files a/i18n/wp-mailjet.mo and /dev/null differ diff --git a/i18n/wp-mailjet.po b/i18n/wp-mailjet.po deleted file mode 100755 index 51db6f6e..00000000 --- a/i18n/wp-mailjet.po +++ /dev/null @@ -1,526 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Mailjet for wordpress\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-03 17:54+0300\n" -"PO-Revision-Date: 2018-07-03 17:54+0300\n" -"Last-Translator: Mailjet \n" -"Language-Team: Mailjet \n" -"Language: en\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" -"X-Poedit-Basepath: ..\n" -"X-Generator: Poedit 2.0.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-SearchPath-0: .\n" - -#: mailjet-class.php:101 -msgid "Manage your Mailjet lists" -msgstr "Mailjet Lists" - -#: mailjet-class.php:101 -msgid "Lists" -msgstr "List:" - -#: mailjet-class.php:102 -msgid "Manage your Mailjet campaigns" -msgstr "Manage your Mailjet campaigns" - -#: mailjet-class.php:102 mailjet-class.php:166 -msgid "Campaigns" -msgstr "Campaigns" - -#: mailjet-class.php:103 -msgid "View your Mailjet statistics" -msgstr "View your Mailjet statistics" - -#: mailjet-class.php:103 mailjet-class.php:174 -msgid "Statistics" -msgstr "Statistics" - -#: mailjet-class.php:182 -msgid "Contacts" -msgstr "Contacts" - -#: mailjet-options.php:46 -msgid "Manage your mailjet lists and settings" -msgstr "Manage your mailjet lists and settings" - -#: mailjet-options.php:55 -msgid "Change your mailjet settings" -msgstr "Mailjet Settings" - -#: mailjet-options.php:55 wp-mailjet.php:153 -msgid "Settings" -msgstr "Settings" - -#: mailjet-options.php:72 -msgid "Mailjet Settings" -msgstr "Mailjet Settings" - -#: mailjet-options.php:75 -msgid "Share the love!" -msgstr "Share the love!" - -#: mailjet-options.php:80 -msgid "Improve your email deliverability and monitor action in real time." -msgstr "Improve your email deliverability and monitor action in real time." - -#: mailjet-options.php:80 -msgid "Tweet" -msgstr "Tweet" - -#: mailjet-options.php:88 -#, php-format -msgid "" -"Create " -"your Mailjet account if you don't have any." -msgstr "" -"Create " -"your Mailjet account if you don't have any." - -#: mailjet-options.php:89 -msgid "" -"Log in with your account through the login form below or visit your account " -"page to get your API keys and set up them below." -msgstr "" -"Log in with your account through the login form below or visit your account " -"page to get your API keys and set up them below." - -#: mailjet-options.php:90 -msgid "" -"Create a new " -"list if you don't have one or need a new one." -msgstr "" -"Create a new " -"list if you don't have one or need a new one." - -#: mailjet-options.php:91 -msgid "" -"Add the email collection widget to your sidebar " -"or footer." -msgstr "" -"Add the email collection widget to your sidebar " -"or footer." - -#: mailjet-options.php:92 -msgid "" -"Create a " -"campaign on mailjet.com to send your newsletter." -msgstr "" -"Create a " -"campaign on mailjet.com to send your newsletter." - -#: mailjet-options.php:93 -msgid "" -"Should you have any questions or encounter any difficulties, please consult " -"our User Guide or contact our technical Support Team" -msgstr "" -"Should you have any questions or encounter any difficulties, please consult " -"our User Guide or contact our technical Support Team" - -#: mailjet-options.php:97 -msgid "Mailjet Plugin" -msgstr "Mailjet Plugin" - -#: mailjet-options.php:106 -msgid "API key" -msgstr "API key" - -#: mailjet-options.php:107 -msgid "Secret key" -msgstr "Secret key" - -#: mailjet-options.php:110 -msgid "API Settings" -msgstr "API Settings" - -#: mailjet-options.php:112 -#, php-format -msgid "" -"You can get your API keys from your mailjet account. Please also make " -"sure the sender address %s is active in your account" -msgstr "" -"You can get your API keys from your mailjet account. Please also make " -"sure the sender address %s is active in your account" - -#: mailjet-options.php:121 -msgid "Enabled" -msgstr "Enabled" - -#: mailjet-options.php:122 -msgid "Enable email through Mailjet" -msgstr "Enable email through Mailjet" - -#: mailjet-options.php:126 -msgid "SSL Enabled (only with port 465)" -msgstr "SSL Enabled (only with port 465)" - -#: mailjet-options.php:128 -msgid "Enable SSL communication with mailjet.com" -msgstr "Enable SSL communication with mailjet.com" - -#: mailjet-options.php:140 -msgid "Port to use for SMTP communication" -msgstr "Port to use for SMTP communication" - -#: mailjet-options.php:142 -msgid "Send test email" -msgstr "Send test email" - -#: mailjet-options.php:143 -msgid "Send test email now" -msgstr "Send test email now" - -#: mailjet-options.php:148 -msgid "Recipient of test email" -msgstr "Recipient of test email" - -#: mailjet-options.php:152 -msgid "From: email address" -msgstr "From: email address" - -#: mailjet-options.php:157 -msgid "From: Name" -msgstr "From: Name:" - -#: mailjet-options.php:161 -msgid "General Settings" -msgstr "General Settings" - -#: mailjet-options.php:163 -msgid "" -"Enable or disable the sending of your emails through your Mailjet account" -msgstr "" -"Enable or disable the sending of your emails through your Mailjet account" - -#: mailjet-options.php:178 -#, fuzzy -#| msgid "Not yet selected, choose list and save settings" -msgid "" -"Initial sync not yet executed, choose a list and save settings to start it" -msgstr "Not yet selected, choose list and save settings" - -#: mailjet-options.php:196 -#, php-format -msgid "" -"Initial users sync is %s! Existing contacts subscribed to %s " -"on %s" -msgstr "" - -#: mailjet-options.php:201 -msgid "" -"Choose a Mailjet contact list which you would like to subscribe your " -"Wordpress users to." -msgstr "" -"Choose a Mailjet contact list which you would like to subscribe your " -"Wordpress users to." - -#: mailjet-options.php:205 -msgid "Disable initial sync" -msgstr "Disable initial sync" - -#: mailjet-options.php:212 -msgid "Subscribe existing users to this list" -msgstr "Subscribe existing users to this list" - -#: mailjet-options.php:215 -msgid "Disable autosubscribe" -msgstr "Disable autosubscribe" - -#: mailjet-options.php:222 -msgid "Auto subscribe new users to this list" -msgstr "Auto subscribe new users to this list" - -#: mailjet-options.php:226 -msgid "Subscribe Wordpress users" -msgstr "Subscribe Wordpress users" - -#: mailjet-options.php:239 -#, fuzzy -#| msgid "Not yet selected, choose list and save settings" -msgid "" -"Comment author sync not yet activated, choose a list and save settings to " -"activate it" -msgstr "Not yet selected, choose list and save settings" - -#: mailjet-options.php:256 -#, php-format -msgid "Comment authors sync is %s!" -msgstr "" - -#: mailjet-options.php:262 -msgid "" -"This feature adds a \"Subscribe to our mailing list\" checkbox in the " -"\"Leave a reply\" form, so that comment authors can automatically join a " -"contact list of your choice." -msgstr "" -"This feature adds a \"Subscribe to our mailing list\" checkbox in the " -"\"Leave a reply\" form, so that comment authors can automatically join a " -"contact list of your choice." - -#: mailjet-options.php:266 -msgid "Disable comment authors subscription" -msgstr "Disable comment authors subscription" - -#: mailjet-options.php:273 -msgid "Allow comment authors to subscribe to this list" -msgstr "Allow comment authors to subscribe to this list" - -#: mailjet-options.php:276 -msgid "Subscribe comment authors" -msgstr "Subscribe comment authors" - -#: mailjet-options.php:288 -msgid "Administrator" -msgstr "Administrator" - -#: mailjet-options.php:288 -msgid "User roles able to access the plugin" -msgstr "User roles able to access the plugin" - -#: mailjet-options.php:289 -msgid "Editor" -msgstr "Editor" - -#: mailjet-options.php:290 -msgid "Author" -msgstr "Author" - -#: mailjet-options.php:291 -msgid "Contributor" -msgstr "Contributor" - -#: mailjet-options.php:292 -msgid "Subscriber" -msgstr "Subscriber" - -#: mailjet-options.php:295 -msgid "Access Settings" -msgstr "Access Settings" - -#: mailjet-options.php:297 -msgid "" -"Select which WordPress admin user roles (in addition to Administrator) will " -"also have access to the Mailjet Plug-in" -msgstr "" -"Select which WordPress admin user roles (in addition to Administrator) will " -"also have access to the Mailjet Plug-in" - -#: mailjet-options.php:471 -msgid "" -"Please make sure that you are using the correct API key and secret key " -"associated to your mailjet account (from email)." -msgstr "" -"Please make sure that you are using the correct API key and secret key " -"associated to your mailjet account (from email)." - -#: mailjet-options.php:486 -msgid "Your test mail from Mailjet" -msgstr "Your test mail from Mailjet" - -#: mailjet-options.php:487 -#, php-format -msgid "Your Mailjet configuration is ok!SSL: %s Port: %s" -msgstr "Your Mailjet configuration is ok!SSL: %s Port: %s" - -#: mailjet-options.php:496 -msgid " and your test message was sent." -msgstr " and your test message was sent." - -#: mailjet-options.php:503 mailjet-options.php:505 -msgid "Your settings have been saved successfully" -msgstr "Your settings have been saved successfully" - -#: mailjet-options.php:507 -msgid "" -"Your settings have been saved, but your port and SSL settings were changed " -"as follows to ensure delivery" -msgstr "" -"Your settings have been saved, but your port and SSL settings were changed " -"as follows to ensure delivery" - -#: mailjet-options.php:517 -#, php-format -msgid "" -"Please verify that you have entered your API and secret key correctly. If " -"this is the case and you have still this error message, please go to Account " -"API keys (%s) to regenerate a new " -"Secret Key for the plug-in." -msgstr "" -"Please verify that you have entered your API and secret key correctly. If " -"this is the case and you have still this error message, please go to Account " -"API keys (%s) to regenerate a new " -"Secret Key for the plug-in." - -#: mailjet-options.php:521 -msgid "There is an error with your settings. please correct and try again" -msgstr "There is an error with your settings. please correct and try again" - -#: mailjet-widget.php:51 -#, fuzzy -#| msgid "Allow comment authors to subscribe to this list" -msgid "Allows your visitors to subscribe to one of your lists" -msgstr "Allow comment authors to subscribe to this list" - -#: mailjet-widget.php:57 -msgid "Mailjet Subscription widget" -msgstr "Mailjet Subscription widget" - -#: mailjet-widget.php:117 -msgid "" -"You are either v1 user or we could not fetch user contact properties. Please " -"contact our support team to discuss migrating to v3 user where you will have " -"contact properties available. You can still configure a Mailjet subscription " -"widget by clicking on \"Next\" button and complete step2 and step3." -msgstr "" -"You are either v1 user or we could not fetch user contact properties. Please " -"contact our support team to discuss migrating to v3 user where you will have " -"contact properties available. You can still configure a Mailjet subscription " -"widget by clicking on \"Next\" button and complete step2 and step3." - -#: mailjet-widget.php:472 -msgid "Email field is empty" -msgstr "" - -#: mailjet-widget.php:477 -msgid "Missing list id" -msgstr "" - -#: mailjet-widget.php:482 wp-mailjet.php:229 wp-mailjet.php:304 -msgid "Invalid email" -msgstr "Invalid email" - -#: mailjet-widget.php:492 -#, php-format -msgid "The contact %s is already subscribed" -msgstr "The contact %s is already subscribed" - -#: mailjet-widget.php:545 wp-mailjet.php:310 -msgid "Confirm your mailing list subscription" -msgstr "Confirm your mailing list subscription" - -#: mailjet-widget.php:546 wp-mailjet.php:311 -msgid "Please Confirm Your Subscription To" -msgstr "Please Confirm Your Subscription To" - -#: mailjet-widget.php:549 wp-mailjet.php:314 -msgid "Click here to confirm" -msgstr "Click here to confirm" - -#: mailjet-widget.php:550 wp-mailjet.php:315 -msgid "You may copy/paste this link into your browser:" -msgstr "You may copy/paste this link into your browser:" - -#: mailjet-widget.php:552 wp-mailjet.php:317 -msgid "" -"Did not ask to subscribe to this list? Or maybe you have changed your mind? " -"Then simply ignore this email and you will not be subscribed" -msgstr "" -"Did not ask to subscribe to this list? Or maybe you have changed your mind? " -"Then simply ignore this email and you will not be subscribed" - -#: mailjet-widget.php:553 wp-mailjet.php:318 -msgid "Thanks," -msgstr "Thanks," - -#: mailjet-widget.php:560 wp-mailjet.php:324 -msgid "Subscription Confirmation" -msgstr "Subscription Confirmation" - -#: mailjet-widget.php:561 -msgid "" -"Subscription confirmation email sent. Please check your inbox and confirm " -"the subscription." -msgstr "" -"Subscription confirmation email sent. Please check your inbox and confirm " -"the subscription." - -#: mailjet-widget.php:575 -msgid "Error. Token verification failed." -msgstr "Error. Token verification failed." - -#: mailjet-widget.php:620 wp-mailjet.php:262 -#, php-format -msgid "Thanks for subscribing with %s" -msgstr "Thanks for subscribing with %s" - -#: mailjet-widget.php:697 -msgid "your@email.com" -msgstr "your@email.com" - -#: view/options-form.php:51 -msgid "Save options" -msgstr "Save options" - -#: wp-mailjet.php:76 -msgid "" -"Mailjet plugin requires PHP 5.3 to function properly. Please upgrade PHP" -msgstr "" - -#: wp-mailjet.php:126 -#, php-format -msgid "" -"The mailjet plugin is enabled but your credentials are not set. Please do so now to send your emails through Mailjet Hide Notice" -msgstr "" -"The mailjet plugin is enabled but your credentials are not set. Please do so now to send your emails through Mailjet Hide Notice" - -#: wp-mailjet.php:181 wp-mailjet.php:199 -msgid "Subscribe to our mailing list" -msgstr "Subscribe to our mailing list" - -#: wp-mailjet.php:271 -#, fuzzy, php-format -#| msgid "The contact %s is already subscribed" -msgid "The contact %s is unsubscribed" -msgstr "The contact %s is already subscribed" - -#, fuzzy -#~| msgid "Please Confirm Your Subscription To" -#~ msgid "Please confirm your subscription" -#~ msgstr "Please Confirm Your Subscription To" - -#, fuzzy -#~| msgid "Auto subscribe new users to this list" -#~ msgid "Yes, subscribe me to this list" -#~ msgstr "Auto subscribe new users to this list" - -#, fuzzy -#~| msgid "Not yet subscribed, chose list and save settings" -#~ msgid "Not yet subscribed, choose list and save settings" -#~ msgstr "Not yet subscribed, chose list and save settings" - -#~ msgid "Existing contacts already subscribed to contact list: %s" -#~ msgstr "Existing contacts already subscribed to contact list: %s" - -#~ msgid "Currently selected contact list: %s" -#~ msgstr "Currently selected contact list: %s" - -#~ msgid "Subscribe" -#~ msgstr "Subscribe" - -#~ msgid "Thanks for subscribing with %s to contact list %s" -#~ msgstr "Thanks for subscribing with %s to contact list %s" - -#~ msgid "The contact %s is removed from contact list %s" -#~ msgstr "The contact %s is removed from contact list %s" diff --git a/index.php b/index.php new file mode 100644 index 00000000..e71af0ef --- /dev/null +++ b/index.php @@ -0,0 +1 @@ +\n" +"Language: de_DE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;" +"esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 src/includes/MailjetMenu.php:97 +#: src/includes/SettingsPages/AllSetup.php:70 src/includes/SettingsPages/ConnectAccountSettings.php:143 +#: src/includes/SettingsPages/Dashboard.php:80 src/includes/SettingsPages/InitialContactListsSettings.php:275 +#: src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "Verbinden Sie Ihr Mailjet-Konto" + +#: src/admin/partials/MailjetAdminDisplay.php:36 src/includes/MailjetMenu.php:100 +#: src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "Einstellungen senden" + +#: src/admin/partials/MailjetAdminDisplay.php:45 src/includes/MailjetMenu.php:103 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "Abonnement-Optionen" + +#: src/admin/partials/MailjetAdminDisplay.php:54 src/includes/MailjetMenu.php:106 +#: src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "Benutzerzugang" + +#: src/admin/partials/MailjetAdminDisplay.php:63 src/includes/MailjetMenu.php:109 +#: src/includes/SettingsPages/IntegrationsSettings.php:116 src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "Integrationen" + +#: src/includes/MailjetMail.php:116 +msgid "Email sending failed. Please review your smtp configuration and try again later" +msgstr "" +"Die Test-E-Mail konnte nicht gesendet werden. Bitte stellen Sie sicher, dass Ihr Server die SMTP-Ports nicht " +"blockiert. Überprüfen Sie auch, ob Sie die korrekten API- und Secret Keys und eine gültige Absender-Adresse von " +"Ihrem Mailjet-Konto verwenden" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "" + +#: src/includes/MailjetMail.php:131 +#, php-format +msgid "Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s" +msgstr "" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "Verbinden Sie Ihr Mailjet-Konto um loszulegen" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 +#: src/includes/SettingsPages/ConnectAccountSettings.php:132 src/includes/SettingsPages/Dashboard.php:72 +#: src/includes/SettingsPages/EnableSendingSettings.php:223 src/includes/SettingsPages/IntegrationsSettings.php:163 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "Einstellungen" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "Einstellungen aktualisieren" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "Statistiken" + +#: src/includes/MailjetMenu.php:80 src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "Konfigurieren Sie Ihre Listen" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "Es ist alles vorbereitet!" + +#: src/includes/MailjetMenu.php:91 src/includes/SettingsPages/Dashboard.php:39 +#: src/includes/SettingsPages/InitialContactListsSettings.php:240 src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "Willkommen beim Mailjet-Plugin für Wordpress" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys" +msgstr "" +"Bitte stellen Sie sicher, dass Sie den richtigen API-Key und Secret Key für Ihr Mailjet-Konto verwenden: https://app.mailjet.com/account/api_keys" + +#: src/includes/MailjetSettings.php:179 +msgid "" +"Your Mailjet API credentials are invalid or not yet configured. Please check and configure them to proceed further." +msgstr "" + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "Was möchten Sie als nächstes tun?" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "Fügen Sie Ihrer Website ein Anmeldeformular hinzu" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "" +"Go to the widget management page and add the Mailjet Subscription Widget to your website to start collecting email " +"addresses." +msgstr "" +"Gehen Sie zur Widget-Verwaltungsseite und fügen Sie das Mailjet Subscription Widget zu Ihrer Website hinzu, um E-" +"Mail-Adressen zu sammeln." + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "Meine Widgets verwalten" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "Senden Sie eine E-Mail-Kampagne" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns and click on \"Create a campaign\" to " +"create and send your email." +msgstr "" +"Sind Sie bereit, einen Newsletter an Ihre Abonnenten zu versenden? Gehen Sie einfach zu Ihren Kampagnen und " +"klicken Sie auf \"Create a campaign\", um Ihre E-Mail zu erstellen und zu versenden." + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "Kampagne erstellen" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "Wordpress E-Mail-Versand konfigurieren" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "Enable and configure sending of all your Wordpress emails (transactional emails, etc...) through Mailjet." +msgstr "" +"Aktivieren und konfigurieren Sie den Versand aller Ihrer Wordpress-E-Mails (Transaktions-E-Mails, etc...) über " +"Mailjet." + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "Konfigurieren" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, php-format +msgid "or Go to your Mailjet Plugin Homepage" +msgstr "oder Gehen Sie zu Ihrer Mailjet Plugin Homepage" + +#: src/includes/SettingsPages/AllSetup.php:71 src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "Brauchen Sie Hilfe?" + +#: src/includes/SettingsPages/AllSetup.php:73 src/includes/SettingsPages/ConnectAccountSettings.php:167 +#: src/includes/SettingsPages/Dashboard.php:83 src/includes/SettingsPages/EnableSendingSettings.php:258 +#: src/includes/SettingsPages/InitialContactListsSettings.php:278 src/includes/SettingsPages/InitialSettings.php:222 +#: src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 +#: src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "Zum Guide" + +#: src/includes/SettingsPages/AllSetup.php:74 src/includes/SettingsPages/ConnectAccountSettings.php:168 +#: src/includes/SettingsPages/Dashboard.php:84 src/includes/SettingsPages/EnableSendingSettings.php:259 +#: src/includes/SettingsPages/InitialContactListsSettings.php:279 src/includes/SettingsPages/InitialSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 +#: src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "Unser Support-Team zu kontaktieren" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and paste your credentials bellow" +msgstr "" +"Gehen Sie in Ihrem Mailjet-Konto zu My Account > API Keys und fügen Sie Ihre Zugangsdaten unten ein" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "Api Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "Ihren API-Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "Geheimer Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "Ihren Geheimer Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "Ihre Änderungen wurden gespeichert" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "Zurück zum Dashboard" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 +#: src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 +#: src/includes/SettingsPages/UserAccessSettings.php:159 src/widget/views/admin.php:202 +#: src/widget/views/admin.php:497 +msgid "Save" +msgstr "Speichern" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 +#: src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 +#: src/includes/SettingsPages/UserAccessSettings.php:162 src/widget/views/admin.php:203 +#: src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "Abbrechen" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "Newsletter versenden" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "Erstellen und verwalten Sie Ihre Newsletter. Sehen Sie sich Ihre Kampagnenstatistiken an." + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "Meine Kampagnen" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "Meine Kontakte verwalten" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "Betrachten und verwalten Sie Ihre Kontaktlisten" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "Meine Kontaktlisten" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "Abonnementformular hinzufügen" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "Passen Sie ein Anmeldeformular an und fügen Sie es Ihrer Wordpress Website hinzu" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "Meine Widgets" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "Statistiken anzeigen" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "Zeigen Sie Ihre Sendestatistiken über einen bestimmten Zeitraum an" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "Meine Statistiken" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "Einstellungen aktualisieren" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "Überprüfen und ändern Sie Ihre Plugin-Einstellungen" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "Enable or disable the sending of your emails through your Mailjet account" +msgstr "Aktivieren oder deaktivieren Sie den Versand Ihrer E-Mails über Ihr Mailjet-Konto" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "E-Mail-Versand über Mailjet aktivieren" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "Von: Name" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "z.B. Jenny Ford" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "Von: name@email.com" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "Port für die SMTP-Kommunikation" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "Enable SSL communication with mailjet.com (only available with port 465)" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "Test versenden" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "Empfänger der Test-E-Mail" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "Senden" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 +#: src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "E-Mail-Versand über Mailjet aktivieren" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "" +"Can not connect to Mailjet with the selected settings. Check if a firewall is blocking connections to the Mailjet " +"ports." +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +#, fuzzy +#| msgid "You have to provide a valid email address to send test email to" +msgid "Please provide a valid email address" +msgstr "Bitte geben Sie eine gültige E-Mail Adresse ein" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't block the SMTP ports. Also double check " +"that you are using correct API and Secret keys and a valid sending address from your Mailjet account." +msgstr "" +"Die Test-E-Mail konnte nicht gesendet werden. Bitte stellen Sie sicher, dass Ihr Server die SMTP-Ports nicht " +"blockiert. Überprüfen Sie auch, ob Sie die korrekten API- und Secret Keys und eine gültige Absender-Adresse von " +"Ihrem Mailjet-Konto verwenden." + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "Ihre Test-E-Mail wurde erfolgreich versendet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +msgid "Your settings have been saved, but your port and SSL settings were changed to ensure delivery" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You can add your Wordpress subscribers to one " +"of them, or use them to collect new email addresses." +msgstr "" +"Hier sind die Kontaktlisten, die wir in Ihrem Mailjet-Konto gefunden haben. Sie können Ihre Wordpress-User zu so " +"einer Liste hinzufügen oder sie verwenden, um neue E-Mail-Adressen zu sammeln." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "Ihrer Mailjet Kontaktliste" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +msgid "contact" +msgstr "kontakt" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "kontakte" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "Neue Liste erstellen" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "Benennen Sie Ihre Liste (max. 50 Zeichen)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "Synchronisieren Sie Ihre Wordpress-User" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "" +"If you wish, you can add your Wordpress website users (readers, authors, administrators, …) to a contact list." +msgstr "" +"Wenn Sie möchten, können Sie Ihre Wordpress Webseite-User (Leser, Autoren, Administratoren, ...) zu einer " +"Kontaktliste hinzufügen." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 +#: src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "Automatically add all my future Wordpress subscribers to a specific contact list" +msgstr "Fügen Sie automatisch alle zukünftigen Wordpress-User zur folgenden Liste hinzu" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "Also, add existing %s Wordpress users (initial synchronization)" +msgstr "Auch vorhandene %s Wordpress-User hinzufügen (initiale Synchronisation)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:180 +#: src/includes/SettingsPages/InitialContactListsSettings.php:201 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:159 +msgid "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." +msgstr "" +"Die Einstellungen konnten nicht gespeichert werden. Bitte versuchen Sie es erneut oder kontaktieren Sie den " +"Mailjet-Support, falls das Problem weiterhin besteht." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:190 +msgid "Congratulations! You have just created a new contact list!" +msgstr "Glückwunsch! Sie haben gerade eine neue Kontaktliste erstellt!" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:196 +#, php-format +msgid "A contact list with name %s already exists" +msgstr "Das Property ist leer oder ungültig - %s! Bitte versuchen Sie es erneut" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 src/includes/SettingsPages/InitialSettings.php:168 +msgid "" +"Mailjet is an email service provider. With this plugin, easily send newsletters to your website users, directly " +"from Wordpress." +msgstr "" +"Mailjet ist ein E-Mail Service Provider. Mit diesem Plugin können Sie ganz einfach Newsletter an Ihre Webseite-" +"User versenden, direkt aus Wordpress." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "Anwenden & Fortfahren" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "Diesen Schritt überspringen" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "Nächste" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "Benötigen Sie Hilfe?" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My Account > API Keys and paste your credentials below" +msgstr "" +"Wenn Sie bereits ein Mailjet-Konto haben, gehen Sie zu Mein Konto > API-Schlüssel und fügen Sie Ihre Zugangsdaten unten ein" + +#: src/includes/SettingsPages/InitialSettings.php:182 +msgid "Connect your account" +msgstr "Verbinden Sie Ihr Mailjet-Konto" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "Sie haben noch kein Mailjet-Konto?" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "Ein Konto erstellen" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "Sammeln Sie E-Mail-Adressen…" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "E-Mail-Adressen werden von Ihrer Website gesammelt" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "...und fügen Sie sie automatisch zu einer Kontaktliste hinzu" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "Email are added to your contact list" +msgstr "E-Mails werden zu Ihrer Kontaktliste hinzugefügt" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "Wir kümmern uns um den Versand Ihrer Newsletter" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "Easily create and send newsletters to your subscribers from Wordpress. Mailjet will deliver them!" +msgstr "Einfaches Erstellen und Versenden von Newslettern an Ihre Wordpress-Abonnenten. Mailjet bietet es an!" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "Select which Wordpress user roles (in addition to Administrator) will also have access to the Mailjet Plugin" +msgstr "" +"Wählen Sie aus, welche Wordpress Admin-User-Rollen (zusätzlich zum Administrator) auch Zugriff auf das Mailjet " +"Plugin haben sollen" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "WooCommerce Integration aktivieren" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +msgid "Display \"Subscribe to our newsletter\" checkbox in the checkout page and add subscibers to this list" +msgstr "" +"Afficher la case à cocher \"S'inscrire à notre newsletter\" sur la page de paiement et ajouter les abonnés à cette " +"liste" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +#, fuzzy +#| msgid "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." +msgid "The settings could not be saved. Please select a contact list to subscribe WooCommerce users to." +msgstr "" +"Die Einstellungen konnten nicht gespeichert werden. Bitte versuchen Sie es erneut oder kontaktieren Sie den " +"Mailjet-Support, falls das Problem weiterhin besteht." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "" +"Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" form to allow comment authors to join " +"a specific contact list" +msgstr "" +"Aktivieren Sie das Kontrollkästchen “Newsletter abonnieren” auf der Checkout-Seite und fügen Sie Abonnenten zu " +"diesen Listen hinzu" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "Abonnement-Optionen" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "Wählen Sie bitte eine Kontaktliste." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "Something went wrong with adding existing Wordpress users to your Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "All Wordpress users were successfully added to your Mailjet contact list" +msgstr "Alle Wordpress-Benutzer wurden erfolgreich zu Ihrer Mailjet-Kontaktliste hinzugefügt" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +msgid "Subscribe to our newsletter" +msgstr "Ja, ich möchte diesen Newsletter abonnieren" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "Bitte bestätigen Sie Ihre Anmeldung" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "To receive newsletters from %s please confirm your subscription by clicking the following button:" +msgstr "" +"Um den Newsletter von %s zu erhalten, bestätigen Sie bitte Ihr Abonnement, indem Sie auf den folgenden Button " +"klicken:" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "Ja, ich möchte diesen Newsletter abonnieren" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message." +msgstr "" +"Wenn Sie diese E-Mail versehentlich erhalten haben oder sich nicht mehr anmelden möchten, ignorieren Sie diese E-" +"Mail einfach." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "Anmeldebestätigung" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "Benutzerzugang" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "Administrator" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "Redakteur" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "Autor" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "Mitarbeiter" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "Abonnent" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "Ihre Änderungen wurden gespeichert" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "Ermöglicht Ihren Besuchern die Anmeldung für eine Ihrer Listen" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "Mailjet Abonnement Widget" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "Englisch" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "Französisch" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "Deutsch" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "Spanisch" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "Italienisch" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "ihre@email.com" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "Angemeldet" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "Subscription confirmation email sent. Please check your inbox and confirm your subscription." +msgstr "" +"E-Mail zur Bestätigung des Abonnements gesendet. Bitte überprüfen Sie Ihren Posteingang und bestätigen Sie Ihr " +"Abonnement." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "Ihr Abonnement wurde erfolgreich bestätigt." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "Bitte geben Sie eine E-Mail-Adresse an" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "Diese E-Mail-Adresse ist bereits registriert." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "Der eingegebene Wert ist nicht im richtigen Format." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "A technical issue has prevented your subscription. Please try again later." +msgstr "Ein technisches Problem hat Ihr Abonnement verhindert. Bitte versuchen Sie es später noch einmal." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message" +msgstr "" +"Wenn Sie diese E-Mail versehentlich erhalten haben oder sich nicht mehr anmelden möchten, ignorieren Sie diese E-" +"Mail einfach" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "Wählen Sie die von Ihrem Anmeldeformular unterstützten Sprachen aus:" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "Titel des Formulars:" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "Newsletter abonnieren" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "E-Mail-Adressen hinzufügen zu:" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "Eine Liste wählen" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "Erweiterte Formularanpassung" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and customize the labels, error messages and " +"confirmation email wordings." +msgstr "" +"Fügen Sie weitere Felder zu Ihrem Formular hinzu (z.B.: Vorname, Nachname, Geburtstag...) und passen Sie die " +"Beschriftungen, Fehlermeldungen und Bestätigungs-E-Mails an." + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "Passen Sie Ihr Abonnement-Formular an" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "Formularfelder" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "Formular-Validierungsmeldungen" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "Inhalt der Bestätigungs-E-Mail" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "\"Danke\"-Seite" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "Sie können bis zu 5 Kontakteigenschaften hinzufügen, um zusätzliche Daten zu sammeln:" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "Eigenschaft" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "Eigenschaften" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "Wählen Sie eine Kontakteigenschaft" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "Neue Liste erstellen" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "Benennen Sie Ihre Eigenschaft (ohne Leerzeichen)" + +#: src/widget/views/admin.php:184 +msgid "Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " +msgstr "Inakzeptable Zeichen: leerzeichen , * + - / \" ' : [ ] ( ) > < = ; $ " + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "Eigenschaftstyp" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "Optional" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "Pflichtfeld" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "Versteckt" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "Passen Sie den Platzhaltertext für das E-Mail-Adressfeld an:" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "E-Mail-Adressfeld Platzhaltertext" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "Passen Sie die Beschriftung der Übermittlungsschaltfläche an:" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "Button-Bezeichnung" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as they interact with the subscription form. " +"Leave empty fields to use the default values." +msgstr "" +"Sie können die Fehler- und Erfolgsmeldungen, die Ihren Usern während der Interaktion mit dem Anmeldeformular " +"angezeigt werden, anpassen. Lassen Sie Felder frei, um die Standardwerte zu verwenden." + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "Beschreibung" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "Formular erfolgreich abgeschickt" + +#: src/widget/views/admin.php:306 +msgid "Subscription confirmed (displayed after the user has clicked the confirmation email)" +msgstr "Abonnement bestätigt (wird angezeigt, nachdem der Benutzer auf die Bestätigungs-E-Mail geklickt hat)" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "Error: E-Mail-Feld ist leer" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "Error: Die E-Mail-Adresse ist registriert" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "Error: Ungültiges Datenformat (gilt nur für Zahlen und Daten)" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "Generische technische Fehlermeldung" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a button they need to click on to confirm " +"their subscription. You can customize the text of the confirmation email if you wish. Leave empty fields to use " +"the default values." +msgstr "" +"Wenn ein User das Formular ausfüllt, erhält er eine E-Mail mit einer Schaltfläche, auf die er klicken muss, um " +"sein Abonnement zu bestätigen. Sie können den Text der Bestätigungs-E-Mail anpassen, wenn Sie möchten. Lassen Sie " +"Felder frei, um die Standardwerte zu verwenden." + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "E-Mail Betreff" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "E-Mail-Inhalt: Titel" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "E-Mail-Inhalt: Haupttext" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "E-Mail-Inhalt: Beschriftung des Bestätigungsbuttons" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "E-Mail-Inhalt: Text nach dem Button" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful subscription confirmation or leave empty to use " +"the default \"Thank you\" page" +msgstr "" +"Wählen Sie eine Seite von Ihrer Wordpress-Seite aus, die nach erfolgreicher Anmeldebestätigung angezeigt werden " +"soll, oder lassen Sie sie leer, um die Standardseite \"Danke\" zu verwenden" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "" + +msgid "language_checkbox" +msgstr "" + +msgid "title" +msgstr "" + +msgid "list" +msgstr "0" + +msgid "language_mandatory_email" +msgstr "" + +msgid "language_mandatory_button" +msgstr "" + +msgid "contactProperties0" +msgstr "" + +msgid "propertyDataType0" +msgstr "0" + +msgid "EnglishLabel0" +msgstr "" + +msgid "FrenchLabel0" +msgstr "" + +msgid "GermanLabel0" +msgstr "" + +msgid "SpanishLabel0" +msgstr "" + +msgid "ItalianLabel0" +msgstr "" + +msgid "contactProperties1" +msgstr "" + +msgid "propertyDataType1" +msgstr "0" + +msgid "EnglishLabel1" +msgstr "" + +msgid "FrenchLabel1" +msgstr "" + +msgid "GermanLabel1" +msgstr "" + +msgid "SpanishLabel1" +msgstr "" + +msgid "ItalianLabel1" +msgstr "" + +msgid "contactProperties2" +msgstr "" + +msgid "propertyDataType2" +msgstr "0" + +msgid "EnglishLabel2" +msgstr "" + +msgid "FrenchLabel2" +msgstr "" + +msgid "GermanLabel2" +msgstr "" + +msgid "SpanishLabel2" +msgstr "" + +msgid "ItalianLabel2" +msgstr "" + +msgid "contactProperties3" +msgstr "" + +msgid "propertyDataType3" +msgstr "0" + +msgid "EnglishLabel3" +msgstr "" + +msgid "FrenchLabel3" +msgstr "" + +msgid "GermanLabel3" +msgstr "" + +msgid "SpanishLabel3" +msgstr "" + +msgid "ItalianLabel3" +msgstr "" + +msgid "contactProperties4" +msgstr "" + +msgid "propertyDataType4" +msgstr "0" + +msgid "EnglishLabel4" +msgstr "" + +msgid "FrenchLabel4" +msgstr "" + +msgid "GermanLabel4" +msgstr "" + +msgid "SpanishLabel4" +msgstr "" + +msgid "ItalianLabel4" +msgstr "" + +msgid "confirmation_email_message_input" +msgstr "" + +msgid "subscription_confirmed_message_input" +msgstr "" + +msgid "empty_email_message_input" +msgstr "" + +msgid "already_subscribed_message_input" +msgstr "" + +msgid "invalid_data_format_message_input" +msgstr "" + +msgid "generic_technical_error_message_input" +msgstr "" + +msgid "email_subject" +msgstr "" + +msgid "email_content_title" +msgstr "" + +msgid "email_content_main_text" +msgstr "" + +msgid "email_content_confirm_button" +msgstr "" + +msgid "email_content_after_button" +msgstr "" + +#~ msgid "You have been successfully subscribed to a Mailjet contact list" +#~ msgstr "Sie haben sich erfolgreich angemeldet" + +#~ msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." +#~ msgstr "" +#~ "E-Mail zur Bestätigung des Abonnements gesendet. Bitte überprüfen Sie Ihren Posteingang und bestätigen Sie Ihr " +#~ "Abonnement." + +#~ msgid "Newsletter Registration" +#~ msgstr "Newsletter Registrierung" + +#~ msgid "Congratulations, you have successfully subscribed!" +#~ msgstr "Herzlichen Glückwunsch, Sie haben sich erfolgreich angemeldet!" + +#~ msgid "Contacts" +#~ msgstr "Kontakte" + +#~ msgid "Name your list" +#~ msgstr "Benennen Sie Ihre Liste" + +#~ msgid "Mailjet plugin for Wordpress" +#~ msgstr "Willkommen beim Mailjet-Plugin für Wordpress" + +#~ msgid "" +#~ "Mailjet is an email service provider. With this plugin, easily send newsletters to your contacts, directly from " +#~ "Wordpress." +#~ msgstr "" +#~ "Mailjet ist ein E-Mail Service Provider. Mit diesem Plugin können Sie ganz einfach Newsletter an Ihre Webseite-" +#~ "User versenden, direkt aus Wordpress." + +#~ msgid "Mailjet Enable Email Sending" +#~ msgstr "E-Mail-Versand über Mailjet aktivieren" + +#~ msgid "The Matrix has you." +#~ msgstr "Das Matrtix ich dich" diff --git a/languages/wp-mailjet-en_GB.mo b/languages/wp-mailjet-en_GB.mo new file mode 100644 index 00000000..2da57b8f Binary files /dev/null and b/languages/wp-mailjet-en_GB.mo differ diff --git a/languages/wp-mailjet-en_GB.po b/languages/wp-mailjet-en_GB.po new file mode 100644 index 00000000..7eafd97a --- /dev/null +++ b/languages/wp-mailjet-en_GB.po @@ -0,0 +1,1280 @@ +msgid "" +msgstr "" +"Project-Id-Version: Mailjet plugin\n" +"POT-Creation-Date: 2018-12-03 11:06+0200\n" +"PO-Revision-Date: 2019-01-17 15:43+0200\n" +"Last-Translator: \n" +"Language-Team: Ferhan Ismailov \n" +"Language: en_GB\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" +"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" +"_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 +#: src/includes/MailjetMenu.php:97 src/includes/SettingsPages/AllSetup.php:70 +#: src/includes/SettingsPages/ConnectAccountSettings.php:143 +#: src/includes/SettingsPages/Dashboard.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:275 +#: src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "Connect your Mailjet account" + +#: src/admin/partials/MailjetAdminDisplay.php:36 +#: src/includes/MailjetMenu.php:100 +#: src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "Sending settings" + +#: src/admin/partials/MailjetAdminDisplay.php:45 +#: src/includes/MailjetMenu.php:103 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "Subscription options" + +#: src/admin/partials/MailjetAdminDisplay.php:54 +#: src/includes/MailjetMenu.php:106 +#: src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "User access" + +#: src/admin/partials/MailjetAdminDisplay.php:63 +#: src/includes/MailjetMenu.php:109 +#: src/includes/SettingsPages/IntegrationsSettings.php:116 +#: src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "Integrations" + +#: src/includes/MailjetMail.php:116 +msgid "" +"Email sending failed. Please review your smtp configuration and try again " +"later" +msgstr "" +"Email sending failed. Please review your smtp configuration and try again " +"later" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "Your test mail from Mailjet" + +#: src/includes/MailjetMail.php:131 +#, php-format +msgid "" +"Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    " +"Port: %s" +msgstr "" +"Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    " +"Port: %s" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 +#: src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "Connect your Mailjet account to get started" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 +#: src/includes/SettingsPages/ConnectAccountSettings.php:132 +#: src/includes/SettingsPages/Dashboard.php:72 +#: src/includes/SettingsPages/EnableSendingSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:163 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "Settings" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "Manage your Mailjet lists" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "Lists" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "Manage your Mailjet campaigns" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "Campaigns" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "View your Mailjet statistics" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "Statistics" + +#: src/includes/MailjetMenu.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "Configure your lists" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "You're all set up!" + +#: src/includes/MailjetMenu.php:91 src/includes/SettingsPages/Dashboard.php:39 +#: src/includes/SettingsPages/InitialContactListsSettings.php:240 +#: src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "Welcome to the Mailjet plugin for Wordpress" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 +#: src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 +#: src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key " +"associated to your Mailjet account: https://app.mailjet.com/account/api_keys" +msgstr "" +"Please make sure that you are using the correct API key and Secret key " +"associated to your Mailjet account: https://app.mailjet.com/account/api_keys" + +#: src/includes/MailjetSettings.php:179 +msgid "" +"Your Mailjet API credentials are invalid or not yet configured. Please check " +"and configure them to proceed further." +msgstr "" +"Your Mailjet API credentials are invalid or not yet configured. Please check " +"and configure them to proceed further." + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "You have been successfully unsubscribed from a Mailjet contact list" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "Something went wrong with adding a contact to Mailjet contact list" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "What would you like to do next?" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "Add a subscription form to your website" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "" +"Go to the widget management page and add the Mailjet Subscription Widget to " +"your website to start collecting email addresses." +msgstr "" +"Go to the widget management page and add the Mailjet Subscription Widget to " +"your website to start collecting email addresses." + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "Manage my widgets" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "Send an email campaign" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns " +"and click on \"Create a campaign\" to create and send your email." +msgstr "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns " +"and click on \"Create a campaign\" to create and send your email." + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "Create a campaign" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "Configure Wordpress email sending" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "" +"Enable and configure sending of all your Wordpress emails (transactional " +"emails, etc...) through Mailjet." +msgstr "" +"Enable and configure sending of all your Wordpress emails (transactional " +"emails, etc...) through Mailjet." + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "Configure" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, php-format +msgid "" +"or Go to your Mailjet Plugin Homepage" +msgstr "" +"or Go to your Mailjet Plugin Homepage" + +#: src/includes/SettingsPages/AllSetup.php:71 +#: src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 +#: src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 +#: src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 +#: src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 +#: src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "Need help?" + +#: src/includes/SettingsPages/AllSetup.php:73 +#: src/includes/SettingsPages/ConnectAccountSettings.php:167 +#: src/includes/SettingsPages/Dashboard.php:83 +#: src/includes/SettingsPages/EnableSendingSettings.php:258 +#: src/includes/SettingsPages/InitialContactListsSettings.php:278 +#: src/includes/SettingsPages/InitialSettings.php:222 +#: src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 +#: src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "Read our user guide" + +#: src/includes/SettingsPages/AllSetup.php:74 +#: src/includes/SettingsPages/ConnectAccountSettings.php:168 +#: src/includes/SettingsPages/Dashboard.php:84 +#: src/includes/SettingsPages/EnableSendingSettings.php:259 +#: src/includes/SettingsPages/InitialContactListsSettings.php:279 +#: src/includes/SettingsPages/InitialSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 +#: src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "Contact our support team" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and " +"paste your credentials bellow" +msgstr "" +"In your Mailjet account, go to My Account > API Keys and " +"paste your credentials bellow" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 +#: src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "Api Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 +#: src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "Your Mailjet API Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 +#: src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "Secret Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 +#: src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "Your Mailjet API Secret" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 +#: src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "Mailjet API credentials" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 +#: src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 +#: src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "Settings Saved" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 +#: src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "Back to dashboard" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 +#: src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 +#: src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 +#: src/includes/SettingsPages/UserAccessSettings.php:159 +#: src/widget/views/admin.php:202 src/widget/views/admin.php:497 +msgid "Save" +msgstr "Save" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 +#: src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 +#: src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 +#: src/includes/SettingsPages/UserAccessSettings.php:162 +#: src/widget/views/admin.php:203 src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "Cancel" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "Send newsletters" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "Create and manage your newsletters. View your campaign statistics." + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "My campaigns" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "Manage my contacts" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "View and manage your contact lists" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "My contact lists" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "Add a subscription form" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "Customize a subscription form and add it to your Wordpress website" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "My widgets" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "View statistics" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "View your sending statistics over a period of time" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "My statistics" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "Update settings" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "Review and modify your plugin settings" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "" +"Enable or disable the sending of your emails through your Mailjet account" +msgstr "" +"Enable or disable the sending of your emails through your Mailjet account" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "Enable sending emails through Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "From: Name" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "e.g. Jenny Ford" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "From: name@email.com" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "Port to use for SMTP communication" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "" +"Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "" +"Enable SSL communication with mailjet.com (only available with port 465)" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "Send a test" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "Recipient of the test email" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "Send" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 +#: src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "Enable sending emails through Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "" +"Can not connect to Mailjet with the selected settings. Check if a firewall " +"is blocking connections to the Mailjet ports." +msgstr "" +"Can not connect to Mailjet with the selected settings. Check if a firewall " +"is blocking connections to the Mailjet ports." + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +msgid "Please provide a valid email address" +msgstr "Please provide a valid email address" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't block " +"the SMTP ports. Also double check that you are using correct API and Secret " +"keys and a valid sending address from your Mailjet account." +msgstr "" +"The test email could not be sent. Please make sure your server doesn't block " +"the SMTP ports. Also double check that you are using correct API and Secret " +"keys and a valid sending address from your Mailjet account." + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "Your test email has been successfully sent" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +#, fuzzy +#| msgid "" +#| "Your settings have been saved, but your port and SSL settings were " +#| "changed as follows to ensure delivery" +msgid "" +"Your settings have been saved, but your port and SSL settings were changed " +"to ensure delivery" +msgstr "" +"Your settings have been saved, but your port and SSL settings were changed " +"as follows to ensure delivery" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You can " +"add your Wordpress subscribers to one of them, or use them to collect new " +"email addresses." +msgstr "" +"Here are the contact lists we have detected on your Mailjet account. You can " +"add your Wordpress subscribers to one of them, or use them to collect new " +"email addresses." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "Your Mailjet contact lists" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +#, fuzzy +#| msgid "contacts" +msgid "contact" +msgstr "contacts" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "contacts" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "Create a new list" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "Name your list (max. 50 characters)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "Synchronize your Wordpress users" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "" +"If you wish, you can add your Wordpress website users (readers, authors, " +"administrators, …) to a contact list." +msgstr "" +"If you wish, you can add your Wordpress website users (readers, authors, " +"administrators, …) to a contact list." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 +#: src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "Automatically add Wordpress subscribers to a specific list" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "" +"Automatically add all my future Wordpress subscribers to a specific contact " +"list" +msgstr "" +"Automatically add all my future Wordpress subscribers to a specific contact " +"list" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "Also, add existing %s Wordpress users (initial synchronization)" +msgstr "Also, add existing %s Wordpress users (initial synchronization)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:180 +#: src/includes/SettingsPages/InitialContactListsSettings.php:201 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:159 +msgid "" +"The settings could not be saved. Please try again or in case the problem " +"persists contact Mailjet support." +msgstr "" +"The settings could not be saved. Please try again or in case the problem " +"persists contact Mailjet support." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:190 +msgid "Congratulations! You have just created a new contact list!" +msgstr "Congratulations! You have just created a new contact list!" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:196 +#, php-format +msgid "A contact list with name %s already exists" +msgstr "A contact list with name %s already exists" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "Please enter a valid contact list name" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 +#: src/includes/SettingsPages/InitialSettings.php:168 +msgid "" +"Mailjet is an email service provider. With this plugin, easily send " +"newsletters to your website users, directly from Wordpress." +msgstr "" +"Mailjet is an email service provider. With this plugin, easily send " +"newsletters to your website users, directly from Wordpress." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "Apply & Continue" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "Back" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "Skip this step" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "Next" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 +#: src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "Need help getting started?" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My Account > " +"API Keys and paste your credentials below" +msgstr "" +"If you already have a Mailjet account, go to My Account > " +"API Keys and paste your credentials below" + +#: src/includes/SettingsPages/InitialSettings.php:182 +msgid "Connect your account" +msgstr "Connect your account" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "You don't have a Mailjet account yet?" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "Create an account" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "Collect email addresses..." + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "Email addresses are collected from your website" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "...and add them automatically to a contact list" + +#: src/includes/SettingsPages/InitialSettings.php:206 +#, fuzzy +#| msgid "Email are added to your contact list" +msgid "Email are added to your contact list" +msgstr "Email are added to your contact list" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "We will take care of delivering your newsletter" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "" +"Easily create and send newsletters to your subscribers from Wordpress. " +"Mailjet will deliver them!" +msgstr "" +"Easily create and send newsletters to your subscribers from Wordpress. " +"Mailjet will deliver them!" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 +#: src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "" +"Select which Wordpress user roles (in addition to Administrator) will also " +"have access to the Mailjet Plugin" +msgstr "" +"Select which Wordpress user roles (in addition to Administrator) will also " +"have access to the Mailjet Plugin" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "Enable WooCommerce integration" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +#, fuzzy +#| msgid "" +#| "Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply" +#| "\" form to allow comment authors to join a specific contact list" +msgid "" +"Display \"Subscribe to our newsletter\" checkbox in the checkout page and " +"add subscibers to this list" +msgstr "" +"Display \"Subscribe to our mailing list\" checkbox in the \"Leave a reply\" " +"form to allow comment authors to join a specific contact list" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +#, fuzzy +#| msgid "" +#| "The settings could not be saved. Please try again or in case the problem " +#| "persists contact Mailjet support." +msgid "" +"The settings could not be saved. Please select a contact list to subscribe " +"WooCommerce users to." +msgstr "" +"The settings could not be saved. Please try again or in case the problem " +"persists contact Mailjet support." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "" +"Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" " +"form to allow comment authors to join a specific contact list" +msgstr "" +"Display \"Subscribe to our mailing list\" checkbox in the \"Leave a reply\" " +"form to allow comment authors to join a specific contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "Subscription Options" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "Please enter a valid contact list name." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "No Wordpress users to add to Mailjet contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "" +"Something went wrong with adding existing Wordpress users to your Mailjet " +"contact list" +msgstr "" +"Something went wrong with adding existing Wordpress users to your Mailjet " +"contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "" +"All Wordpress users were successfully added to your Mailjet contact list" +msgstr "" +"All Wordpress users were successfully added to your Mailjet contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "Subscribe to our mailing list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +#, fuzzy +#| msgid "Subscribe to our mailing list" +msgid "Subscribe to our newsletter" +msgstr "Subscribe to our mailing list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "Invalid email" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "Please confirm your subscription" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "" +"To receive newsletters from %s please confirm your subscription by clicking " +"the following button:" +msgstr "" +"To receive newsletters from %s please confirm your subscription by clicking " +"the following button:" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "Yes, subscribe me to this list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, " +"simply ignore this message." +msgstr "" +"If you received this email by mistake or don't wish to subscribe anymore, " +"simply ignore this message." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "Subscription Confirmation" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 +#: src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "User Access" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "Administrator" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "Editor" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "Author" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "Contributor" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "Subscriber" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "User Access Settings Saved" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "Allows your visitors to subscribe to one of your lists" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "Mailjet Subscription Widget" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "English" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "French" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "German" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "Spanish" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "Italian" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "your@email.com" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "Subscribe" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "" +"Subscription confirmation email sent. Please check your inbox and confirm " +"your subscription." +msgstr "" +"Subscription confirmation email sent. Please check your inbox and confirm " +"your subscription." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "Your subscription was successfully confirmed." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "Please provide an email address" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "This email address has already been subscribed." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "The value you entered is not in the correct format." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "" +"A technical issue has prevented your subscription. Please try again later." +msgstr "" +"A technical issue has prevented your subscription. Please try again later." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, " +"simply ignore this message" +msgstr "" +"If you received this email by mistake or don't wish to subscribe anymore, " +"simply ignore this message" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "Customize your subscription form:" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "Title of the form:" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "Sign up to receive the newsletter" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "Add email addresses to:" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "Choose a list" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "Advanced form customization" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and " +"customize the labels, error messages and confirmation email wordings." +msgstr "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and " +"customize the labels, error messages and confirmation email wordings." + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "Customize your subscription form" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "Form fields" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "Form validation messages" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "Confirmation email content" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "\"Thank you\" page" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "You can add up to 5 contact properties to collect additional data:" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "Property" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "Properties" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "Select a property" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "Create new" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "Name your property (no spaces)" + +#: src/widget/views/admin.php:184 +msgid "" +"Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " +msgstr "" +"Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "Property type" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "Type" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "Optional" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "Mandatory" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "Hidden" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "Customize the placeholder text for the email address field:" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "Email address field placeholder text" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "Customize the submission button label:" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "Button label" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as they " +"interact with the subscription form. Leave empty fields to use the default " +"values." +msgstr "" +"You can customize error and success messages displayed to your users as they " +"interact with the subscription form. Leave empty fields to use the default " +"values." + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "Description" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "Form successfully submitted" + +#: src/widget/views/admin.php:306 +msgid "" +"Subscription confirmed (displayed after the user has clicked the " +"confirmation email)" +msgstr "" +"Subscription confirmed (displayed after the user has clicked the " +"confirmation email)" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "Error: email field is empty" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "Error: the email address is already subscribed" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "Error: Invalid data format (this applies only for numbers and dates)" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "Generic technical error message" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a " +"button they need to click on to confirm their subscription. You can " +"customize the text of the confirmation email if you wish. Leave empty fields " +"to use the default values." +msgstr "" +"When a user fills in the form, they will receive an email containing a " +"button they need to click on to confirm their subscription. You can " +"customize the text of the confirmation email if you wish. Leave empty fields " +"to use the default values." + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "Email subject" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "Email content: title" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "Email content: main text" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "Email content: confirmation button label" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "Email content: text after the button" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful subscription " +"confirmation or leave empty to use the default \"Thank you\" page" +msgstr "" +"Select a page from your Wordpress site to show after successful subscription " +"confirmation or leave empty to use the default \"Thank you\" page" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "Default page" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "Could not connect to mailjet api, please try again later!" + +#, fuzzy +#~| msgid "Subscribe to our mailing list" +#~ msgid "Subscribe to our mailing list." +#~ msgstr "Subscribe to our mailing list" + +#~ msgid "You have been successfully subscribed to a Mailjet contact list" +#~ msgstr "You have been successfully subscribed to a Mailjet contact list" + +#~ msgid "" +#~ "Subscription confirmation email sent. Please check your inbox and confirm " +#~ "the subscription." +#~ msgstr "" +#~ "Subscription confirmation email sent. Please check your inbox and confirm " +#~ "the subscription." + +#~ msgid "Newsletter Registration" +#~ msgstr "Newsletter Registration" + +#~ msgid "Congratulations, you have successfully subscribed!" +#~ msgstr "Congratulations, you have successfully subscribed!" + +#~ msgid "Contacts" +#~ msgstr "Contacts" + +#~ msgid "Name your list" +#~ msgstr "Name your list" + +#~ msgid "Mailjet plugin for Wordpress" +#~ msgstr "Mailjet plugin for Wordpress" + +#~ msgid "" +#~ "Mailjet is an email service provider. With this plugin, easily send " +#~ "newsletters to your contacts, directly from Wordpress." +#~ msgstr "" +#~ "Mailjet is an email service provider. With this plugin, easily send " +#~ "newsletters to your contacts, directly from Wordpress." + +#~ msgid "Confirm your mailing list subscription" +#~ msgstr "Confirm your mailing list subscription" + +#~ msgid "Thanks," +#~ msgstr "Thanks," + +#~ msgid "Click here to confirm" +#~ msgstr "Click here to confirm" + +#~ msgid "You may copy/paste this link into your browser:" +#~ msgstr "You may copy/paste this link into your browser:" + +#~ msgid "" +#~ "Did not ask to subscribe to this list? Or maybe you have changed your " +#~ "mind? Then simply ignore this email and you will not be subscribed" +#~ msgstr "" +#~ "Did not ask to subscribe to this list? Or maybe you have changed your " +#~ "mind? Then simply ignore this email and you will not be subscribed" + +#~ msgid "Mailjet Enable Email Sending" +#~ msgstr "Mailjet Enable Email Sending" + +#~ msgid "Your new contact list has been successfully created." +#~ msgstr "Your new contact list has been successfully created." + +#~ msgid "Also activate Mailjet plugin logger, to track your expirience" +#~ msgstr "Also activate Mailjet plugin logger, to track your expirience" + +#~ msgid "Select a Mailjet contact list to add Wordpress users to" +#~ msgstr "Select a Mailjet contact list to add Wordpress users to" + +#~ msgid "Email" +#~ msgstr "Email" + +#~ msgid "Invalid Mailjet API credentials" +#~ msgstr "Invalid Mailjet API credentials" + +#~ msgid "Your test message was NOT sent, please review your settings" +#~ msgstr "Your Mailjet configuration is ok!SSL: %s Port: %s" + +#, fuzzy +#~| msgid "Need help?" +#~ msgid "Need help" +#~ msgstr "Need help?" + +#~ msgid "Enter your Mailjet accoutn API Key value" +#~ msgstr "Enter your Mailjet accoutn API Key value" + +#~ msgid "Enter your Mailjet accoutn API Secret value" +#~ msgstr "Enter your Mailjet accoutn API Secret value" + +#~ msgid "

    Something awesome

    " +#~ msgstr "

    Something awesome

    " + +#~ msgid "Initial mailjet API settings" +#~ msgstr "Initial mailjet API settings" + +#~ msgid "" +#~ "Create your Mailjet account if you don't have any." +#~ msgstr "" +#~ "Create your Mailjet account if you don't have any." + +#~ msgid "" +#~ "Log in with your account through the login form below or visit your account page to get your API keys and set up them below." +#~ msgstr "" +#~ "Log in with your account through the login form below or visit your account page to get your API keys and set up them below." + +#~ msgid "" +#~ "Create a new " +#~ "list if you don't have one or need a new one." +#~ msgstr "" +#~ "Create a new " +#~ "list if you don't have one or need a new one." + +#~ msgid "" +#~ "Add the email collection widget to your " +#~ "sidebar or footer." +#~ msgstr "" +#~ "Add the email collection widget to your " +#~ "sidebar or footer." + +#~ msgid "" +#~ "Create a " +#~ "campaign on mailjet.com to send your newsletter." +#~ msgstr "" +#~ "Create a " +#~ "campaign on mailjet.com to send your newsletter." + +#~ msgid "" +#~ "Should you have any questions or encounter any difficulties, please " +#~ "consult our User Guide or contact our technical Support " +#~ "Team" +#~ msgstr "" +#~ "Should you have any questions or encounter any difficulties, please " +#~ "consult our User Guide or contact our technical Support " +#~ "Team" + +#~ msgid "The Matrix has you." +#~ msgstr "The Matrix has you." + +#~ msgid "" +#~ "You can choose to add your Wordpress subscribers to an existing list or " +#~ "create a new list" +#~ msgstr "" +#~ "You can choose to add your Wordpress subscribers to an existing list or " +#~ "create a new list" + +#~ msgid "Follow the white rabbit." +#~ msgstr "Follow the white rabbit." + +#~ msgid "Widget Title" +#~ msgstr "Widget Title" + +#~ msgid "Text:" +#~ msgstr "Text:" + +#~ msgid "Textarea:" +#~ msgstr "Textarea:" + +#~ msgid "Checkbox" +#~ msgstr "Checkbox" + +#~ msgid "Select" +#~ msgstr "Select" + +#~ msgid "Option 2" +#~ msgstr "Option 2" + +#~ msgid "Option 3" +#~ msgstr "Option 3" + +#~ msgid "text" +#~ msgstr "English Text" + +#~ msgid "textarea" +#~ msgstr "English Textarea" + +#~ msgid "select" +#~ msgstr "option_3" + +#~ msgid "title" +#~ msgstr "en12" + +#~ msgid "language_checkbox" +#~ msgstr "1" + +#~ msgid "list" +#~ msgstr "38823" + +#~ msgid "checkbox" +#~ msgstr "1" diff --git a/languages/wp-mailjet-en_US.mo b/languages/wp-mailjet-en_US.mo new file mode 100644 index 00000000..08a424c1 Binary files /dev/null and b/languages/wp-mailjet-en_US.mo differ diff --git a/languages/wp-mailjet-en_US.po b/languages/wp-mailjet-en_US.po new file mode 100644 index 00000000..9a2efbc5 --- /dev/null +++ b/languages/wp-mailjet-en_US.po @@ -0,0 +1,1098 @@ +msgid "" +msgstr "" +"Project-Id-Version: Mailjet plugin\n" +"POT-Creation-Date: 2018-12-03 11:06+0200\n" +"PO-Revision-Date: 2019-01-17 15:42+0200\n" +"Last-Translator: \n" +"Language-Team: Ferhan Ismailov \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;" +"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 src/includes/MailjetMenu.php:97 src/includes/SettingsPages/AllSetup.php:70 +#: src/includes/SettingsPages/ConnectAccountSettings.php:143 src/includes/SettingsPages/Dashboard.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:275 src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "Connect your Mailjet account" + +#: src/admin/partials/MailjetAdminDisplay.php:36 src/includes/MailjetMenu.php:100 src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "Sending settings" + +#: src/admin/partials/MailjetAdminDisplay.php:45 src/includes/MailjetMenu.php:103 src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "Subscription options" + +#: src/admin/partials/MailjetAdminDisplay.php:54 src/includes/MailjetMenu.php:106 src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "User access" + +#: src/admin/partials/MailjetAdminDisplay.php:63 src/includes/MailjetMenu.php:109 src/includes/SettingsPages/IntegrationsSettings.php:116 +#: src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "Integrations" + +#: src/includes/MailjetMail.php:116 +msgid "Email sending failed. Please review your smtp configuration and try again later" +msgstr "Email sending failed. Please review your smtp configuration and try again later" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "Your test mail from Mailjet" + +#: src/includes/MailjetMail.php:131 +#, fuzzy, php-format +#| msgid "Your Mailjet configuration is ok!SSL: %s Port: %s" +msgid "Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s" +msgstr "Your Mailjet configuration is ok!SSL: %s Port: %s" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "Connect your Mailjet account to get started" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 src/includes/SettingsPages/ConnectAccountSettings.php:132 +#: src/includes/SettingsPages/Dashboard.php:72 src/includes/SettingsPages/EnableSendingSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:163 src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "Settings" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "Manage your Mailjet lists" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "Lists" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "Manage your Mailjet campaigns" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "Campaigns" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "View your Mailjet statistics" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "Statistics" + +#: src/includes/MailjetMenu.php:80 src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "Configure your lists" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "You're all set up!" + +#: src/includes/MailjetMenu.php:91 src/includes/SettingsPages/Dashboard.php:39 src/includes/SettingsPages/InitialContactListsSettings.php:240 +#: src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "Welcome to the Mailjet plugin for Wordpress" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys" +msgstr "" +"Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys" + +#: src/includes/MailjetSettings.php:179 +msgid "Your Mailjet API credentials are invalid or not yet configured. Please check and configure them to proceed further." +msgstr "Your Mailjet API credentials are invalid or not yet configured. Please check and configure them to proceed further." + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "You have been successfully unsubscribed from a Mailjet contact list" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "Something went wrong with adding a contact to Mailjet contact list" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "What would you like to do next?" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "Add a subscription form to your website" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "Go to the widget management page and add the Mailjet Subscription Widget to your website to start collecting email addresses." +msgstr "Go to the widget management page and add the Mailjet Subscription Widget to your website to start collecting email addresses." + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "Manage my widgets" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "Send an email campaign" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns and click on \"Create a campaign\" to create and send your email." +msgstr "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns and click on \"Create a campaign\" to create and send your email." + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "Create a campaign" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "Configure Wordpress email sending" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "Enable and configure sending of all your Wordpress emails (transactional emails, etc...) through Mailjet." +msgstr "Enable and configure sending of all your Wordpress emails (transactional emails, etc...) through Mailjet." + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "Configure" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, fuzzy, php-format +#| msgid "Go to your Mailjet Plugin Homepage" +msgid "or Go to your Mailjet Plugin Homepage" +msgstr "Go to your Mailjet Plugin Homepage" + +#: src/includes/SettingsPages/AllSetup.php:71 src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "Need help?" + +#: src/includes/SettingsPages/AllSetup.php:73 src/includes/SettingsPages/ConnectAccountSettings.php:167 src/includes/SettingsPages/Dashboard.php:83 +#: src/includes/SettingsPages/EnableSendingSettings.php:258 src/includes/SettingsPages/InitialContactListsSettings.php:278 +#: src/includes/SettingsPages/InitialSettings.php:222 src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "Read our user guide" + +#: src/includes/SettingsPages/AllSetup.php:74 src/includes/SettingsPages/ConnectAccountSettings.php:168 src/includes/SettingsPages/Dashboard.php:84 +#: src/includes/SettingsPages/EnableSendingSettings.php:259 src/includes/SettingsPages/InitialContactListsSettings.php:279 +#: src/includes/SettingsPages/InitialSettings.php:223 src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "Contact our support team" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and paste your credentials bellow" +msgstr "" +"In your Mailjet account, go to My Account > API Keys and paste your credentials bellow" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "Api Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "Your Mailjet API Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "Secret Key" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "Your Mailjet API Secret" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "Mailjet API credentials" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "Settings Saved" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "Back to dashboard" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 src/includes/SettingsPages/UserAccessSettings.php:159 +#: src/widget/views/admin.php:202 src/widget/views/admin.php:497 +msgid "Save" +msgstr "Save" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 src/includes/SettingsPages/UserAccessSettings.php:162 +#: src/widget/views/admin.php:203 src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "Cancel" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "Send newsletters" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "Create and manage your newsletters. View your campaign statistics." + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "My campaigns" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "Manage my contacts" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "View and manage your contact lists" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "My contact lists" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "Add a subscription form" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "Customize a subscription form and add it to your Wordpress website" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "My widgets" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "View statistics" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "View your sending statistics over a period of time" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "My statistics" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "Update settings" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "Review and modify your plugin settings" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "Enable or disable the sending of your emails through your Mailjet account" +msgstr "Enable or disable the sending of your emails through your Mailjet account" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "Enable sending emails through Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "From: Name" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "e.g. Jenny Ford" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "From: name@email.com" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "Port to use for SMTP communication" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "Enable SSL communication with mailjet.com (only available with port 465)" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "Send a test" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "Recipient of the test email" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "Send" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "Enable sending emails through Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "Can not connect to Mailjet with the selected settings. Check if a firewall is blocking connections to the Mailjet ports." +msgstr "Can not connect to Mailjet with the selected settings. Check if a firewall is blocking connections to the Mailjet ports." + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +msgid "Please provide a valid email address" +msgstr "Please provide a valid email address" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't block the SMTP ports. Also double check that you are using correct API and " +"Secret keys and a valid sending address from your Mailjet account." +msgstr "" +"The test email could not be sent. Please make sure your server doesn't block the SMTP ports. Also double check that you are using correct API and " +"Secret keys and a valid sending address from your Mailjet account." + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "Your test email has been successfully sent" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +#, fuzzy +#| msgid "Your settings have been saved, but your port and SSL settings were changed as follows to ensure delivery" +msgid "Your settings have been saved, but your port and SSL settings were changed to ensure delivery" +msgstr "Your settings have been saved, but your port and SSL settings were changed as follows to ensure delivery" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You can add your Wordpress subscribers to one of them, or use them to " +"collect new email addresses." +msgstr "" +"Here are the contact lists we have detected on your Mailjet account. You can add your Wordpress subscribers to one of them, or use them to " +"collect new email addresses." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "Your Mailjet contact lists" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +msgid "contact" +msgstr "contact" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "contacts" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "Create a new list" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "Name your list (max. 50 characters)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "Synchronize your Wordpress users" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "If you wish, you can add your Wordpress website users (readers, authors, administrators, …) to a contact list." +msgstr "If you wish, you can add your Wordpress website users (readers, authors, administrators, …) to a contact list." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "Automatically add Wordpress subscribers to a specific list" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "Automatically add all my future Wordpress subscribers to a specific contact list" +msgstr "Automatically add all my future Wordpress subscribers to a specific contact list" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "Also, add existing %s Wordpress users (initial synchronization)" +msgstr "Also, add existing %s Wordpress users (initial synchronization)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:180 src/includes/SettingsPages/InitialContactListsSettings.php:201 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:159 +msgid "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." +msgstr "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:190 +msgid "Congratulations! You have just created a new contact list!" +msgstr "Congratulations! You have just created a new contact list!" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:196 +#, php-format +msgid "A contact list with name %s already exists" +msgstr "A contact list with name %s already exists" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "Please enter a valid contact list name" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 src/includes/SettingsPages/InitialSettings.php:168 +msgid "Mailjet is an email service provider. With this plugin, easily send newsletters to your website users, directly from Wordpress." +msgstr "Mailjet is an email service provider. With this plugin, easily send newsletters to your website users, directly from Wordpress." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "Apply & Continue" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "Back" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "Skip this step" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "Next" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "Need help getting started?" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My " +"Account > API Keys and paste your credentials below" +msgstr "" +"If you already have a Mailjet account, go to My " +"Account > API Keys and paste your credentials below" + +#: src/includes/SettingsPages/InitialSettings.php:182 +#, fuzzy +#| msgid "Connect your Mailjet account" +msgid "Connect your account" +msgstr "Connect your Mailjet account" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "You don't have a Mailjet account yet?" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "Create an account" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "Collect email addresses..." + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "Email addresses are collected from your website" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "...and add them automatically to a contact list" + +#: src/includes/SettingsPages/InitialSettings.php:206 +#, fuzzy +#| msgid "Email are added to your contact list" +msgid "Email are added to your contact list" +msgstr "Email are added to your contact list" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "We will take care of delivering your newsletter" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "Easily create and send newsletters to your subscribers from Wordpress. Mailjet will deliver them!" +msgstr "Easily create and send newsletters to your subscribers from Wordpress. Mailjet will deliver them!" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "Select which Wordpress user roles (in addition to Administrator) will also have access to the Mailjet Plugin" +msgstr "Select which Wordpress user roles (in addition to Administrator) will also have access to the Mailjet Plugin" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "Enable WooCommerce integration" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +#, fuzzy +#| msgid "Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" form to allow comment authors to join a specific contact list" +msgid "Display \"Subscribe to our newsletter\" checkbox in the checkout page and add subscibers to this list" +msgstr "Display \"Subscribe to our mailing list\" checkbox in the \"Leave a reply\" form to allow comment authors to join a specific contact list" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +#, fuzzy +#| msgid "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." +msgid "The settings could not be saved. Please select a contact list to subscribe WooCommerce users to." +msgstr "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" form to allow comment authors to join a specific contact list" +msgstr "Display \"Subscribe to our mailing list\" checkbox in the \"Leave a reply\" form to allow comment authors to join a specific contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "Subscription Options" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "Please select a contact list." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "No Wordpress users to add to Mailjet contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "Something went wrong with adding existing Wordpress users to your Mailjet contact list" +msgstr "Something went wrong with adding existing Wordpress users to your Mailjet contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "All Wordpress users were successfully added to your Mailjet contact list" +msgstr "All Wordpress users were successfully added to your Mailjet contact list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "Subscribe to our mailing list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +#, fuzzy +#| msgid "Subscribe to our mailing list" +msgid "Subscribe to our newsletter" +msgstr "Subscribe to our mailing list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "Invalid email" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "Please confirm your subscription" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "To receive newsletters from %s please confirm your subscription by clicking the following button:" +msgstr "To receive newsletters from %s please confirm your subscription by clicking the following button:" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "Yes, subscribe me to this list" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message." +msgstr "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "Subscription Confirmation" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "User Access" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "Administrator" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "Editor" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "Author" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "Contributor" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "Subscriber" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "User Access Settings Saved" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "Allows your visitors to subscribe to one of your lists" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "Mailjet Subscription Widget" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "English" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "French" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "German" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "Spanish" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "Italian" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "your@email.com" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "Subscribe" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "Subscription confirmation email sent. Please check your inbox and confirm your subscription." +msgstr "Subscription confirmation email sent. Please check your inbox and confirm your subscription." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "Your subscription was successfully confirmed." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "Please provide an email address" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "This email address has already been subscribed." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "The value you entered is not in the correct format." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "A technical issue has prevented your subscription. Please try again later." +msgstr "A technical issue has prevented your subscription. Please try again later." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message" +msgstr "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "Choose the languages supported by your subscription form:" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "Title of the form:" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "Sign up to receive the newsletter" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "Add email addresses to:" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "Choose a list" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "Advanced form customization" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and customize the labels, error messages and confirmation email wordings." +msgstr "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and customize the labels, error messages and confirmation email wordings." + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "Customize your subscription form" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "Form fields" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "Form validation messages" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "Confirmation email content" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "\"Thank you\" page" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "You can add up to 5 contact properties to collect additional data:" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "Property" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "Properties" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "Select a property" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "Create new" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "Name your property (no spaces)" + +#: src/widget/views/admin.php:184 +msgid "Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " +msgstr "Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "Property type" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "Type" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "Optional" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "Mandatory" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "Hidden" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "Customize the placeholder text for the email address field:" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "Email address field placeholder text" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "Customize the submission button label:" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "Button label" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as they interact with the subscription form. Leave empty fields to use the " +"default values." +msgstr "" +"You can customize error and success messages displayed to your users as they interact with the subscription form. Leave empty fields to use the " +"default values." + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "Description" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "Form successfully submitted" + +#: src/widget/views/admin.php:306 +msgid "Subscription confirmed (displayed after the user has clicked the confirmation email)" +msgstr "Subscription confirmed (displayed after the user has clicked the confirmation email)" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "Error: email field is empty" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "Error: the email address is already subscribed" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "Error: Invalid data format (this applies only for numbers and dates)" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "Generic technical error message" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a button they need to click on to confirm their subscription. You can " +"customize the text of the confirmation email if you wish. Leave empty fields to use the default values." +msgstr "" +"When a user fills in the form, they will receive an email containing a button they need to click on to confirm their subscription. You can " +"customize the text of the confirmation email if you wish. Leave empty fields to use the default values." + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "Email subject" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "Email content: title" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "Email content: main text" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "Email content: confirmation button label" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "Email content: text after the button" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful subscription confirmation or leave empty to use the default \"Thank you\" page" +msgstr "" +"Select a page from your Wordpress site to show after successful subscription confirmation or leave empty to use the default \"Thank you\" page" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "Default page" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "Could not connect to mailjet api, please try again later!" + +msgid "language_checkbox" +msgstr "" + +msgid "title" +msgstr "" + +msgid "list" +msgstr "0" + +msgid "language_mandatory_email" +msgstr "" + +msgid "language_mandatory_button" +msgstr "" + +msgid "contactProperties0" +msgstr "" + +msgid "propertyDataType0" +msgstr "0" + +msgid "EnglishLabel0" +msgstr "" + +msgid "FrenchLabel0" +msgstr "" + +msgid "GermanLabel0" +msgstr "" + +msgid "SpanishLabel0" +msgstr "" + +msgid "ItalianLabel0" +msgstr "" + +msgid "contactProperties1" +msgstr "" + +msgid "propertyDataType1" +msgstr "0" + +msgid "EnglishLabel1" +msgstr "" + +msgid "FrenchLabel1" +msgstr "" + +msgid "GermanLabel1" +msgstr "" + +msgid "SpanishLabel1" +msgstr "" + +msgid "ItalianLabel1" +msgstr "" + +msgid "contactProperties2" +msgstr "" + +msgid "propertyDataType2" +msgstr "0" + +msgid "EnglishLabel2" +msgstr "" + +msgid "FrenchLabel2" +msgstr "" + +msgid "GermanLabel2" +msgstr "" + +msgid "SpanishLabel2" +msgstr "" + +msgid "ItalianLabel2" +msgstr "" + +msgid "contactProperties3" +msgstr "" + +msgid "propertyDataType3" +msgstr "0" + +msgid "EnglishLabel3" +msgstr "" + +msgid "FrenchLabel3" +msgstr "" + +msgid "GermanLabel3" +msgstr "" + +msgid "SpanishLabel3" +msgstr "" + +msgid "ItalianLabel3" +msgstr "" + +msgid "contactProperties4" +msgstr "" + +msgid "propertyDataType4" +msgstr "0" + +msgid "EnglishLabel4" +msgstr "" + +msgid "FrenchLabel4" +msgstr "" + +msgid "GermanLabel4" +msgstr "" + +msgid "SpanishLabel4" +msgstr "" + +msgid "ItalianLabel4" +msgstr "" + +msgid "confirmation_email_message_input" +msgstr "" + +msgid "subscription_confirmed_message_input" +msgstr "" + +msgid "empty_email_message_input" +msgstr "" + +msgid "already_subscribed_message_input" +msgstr "" + +msgid "invalid_data_format_message_input" +msgstr "" + +msgid "generic_technical_error_message_input" +msgstr "" + +msgid "email_subject" +msgstr "" + +msgid "email_content_title" +msgstr "" + +msgid "email_content_main_text" +msgstr "" + +msgid "email_content_confirm_button" +msgstr "" + +msgid "email_content_after_button" +msgstr "" + +#, fuzzy +#~ msgid "Subscribe to our mailing list." +#~ msgstr "Subscribe to our mailing list" + +#~ msgid "You have been successfully subscribed to a Mailjet contact list" +#~ msgstr "You have been successfully subscribed to a Mailjet contact list" + +#~ msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." +#~ msgstr "Subscription confirmation email sent. Please check your inbox and confirm the subscription." + +#~ msgid "Newsletter Registration" +#~ msgstr "Newsletter Registration" + +#~ msgid "Congratulations, you have successfully subscribed!" +#~ msgstr "Congratulations, you have successfully subscribed!" + +#~ msgid "Contacts" +#~ msgstr "Contacts" + +#~ msgid "Name your list" +#~ msgstr "Name your list" + +#~ msgid "Confirm your mailing list subscription" +#~ msgstr "Confirm your mailing list subscription" + +#~ msgid "Please Confirm Your Subscription To" +#~ msgstr "Please Confirm Your Subscription To" + +#~ msgid "Thanks," +#~ msgstr "Thanks," + +#~ msgid "Click here to confirm" +#~ msgstr "Click here to confirm" + +#~ msgid "You may copy/paste this link into your browser:" +#~ msgstr "You may copy/paste this link into your browser:" + +#~ msgid "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" +#~ msgstr "Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed" + +#~ msgid "Mailjet Enable Email Sending" +#~ msgstr "Mailjet Enable Email Sending" + +#~ msgid "You have to provide a valid email address to send test email to" +#~ msgstr "You have to provide a valid email address to send test email to" + +#~ msgid "Your new contact list has been successfully created." +#~ msgstr "Your new contact list has been successfully created." + +#~ msgid "Mailjet plugin for Wordpress" +#~ msgstr "Mailjet plugin for Wordpress" + +#~ msgid "Mailjet is an email service provider. With this plugin, easily send newsletters to your contacts, directly from Wordpress." +#~ msgstr "Mailjet is an email service provider. With this plugin, easily send newsletters to your contacts, directly from Wordpress." + +#~ msgid "Also activate Mailjet plugin logger, to track your expirience" +#~ msgstr "Also activate Mailjet plugin logger, to track your expirience" + +#~ msgid "contactPropertiesOptions" +#~ msgstr "2924" diff --git a/languages/wp-mailjet-es_ES.mo b/languages/wp-mailjet-es_ES.mo new file mode 100644 index 00000000..87be6a02 Binary files /dev/null and b/languages/wp-mailjet-es_ES.mo differ diff --git a/languages/wp-mailjet-es_ES.po b/languages/wp-mailjet-es_ES.po new file mode 100644 index 00000000..2e5fe8d1 --- /dev/null +++ b/languages/wp-mailjet-es_ES.po @@ -0,0 +1,1226 @@ +msgid "" +msgstr "" +"Project-Id-Version: Mailjet plugin\n" +"POT-Creation-Date: 2018-12-03 11:06+0200\n" +"PO-Revision-Date: 2019-01-17 15:47+0200\n" +"Last-Translator: \n" +"Language-Team: Ferhan Ismailov \n" +"Language: es_ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;" +"esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;" +"__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 src/includes/MailjetMenu.php:97 +#: src/includes/SettingsPages/AllSetup.php:70 +#: src/includes/SettingsPages/ConnectAccountSettings.php:143 +#: src/includes/SettingsPages/Dashboard.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:275 +#: src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "Conecte su cuenta de Mailjet" + +#: src/admin/partials/MailjetAdminDisplay.php:36 src/includes/MailjetMenu.php:100 +#: src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "Configuración de envío" + +#: src/admin/partials/MailjetAdminDisplay.php:45 src/includes/MailjetMenu.php:103 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "Opciones de suscripción" + +#: src/admin/partials/MailjetAdminDisplay.php:54 src/includes/MailjetMenu.php:106 +#: src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "Acceso de usuarios" + +#: src/admin/partials/MailjetAdminDisplay.php:63 src/includes/MailjetMenu.php:109 +#: src/includes/SettingsPages/IntegrationsSettings.php:116 +#: src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "Integraciones" + +#: src/includes/MailjetMail.php:116 +msgid "Email sending failed. Please review your smtp configuration and try again later" +msgstr "" +"No se pudo enviar el correo electrónico de prueba. Por favor, asegúrese de que su " +"servidor no bloquee los puertos SMTP. Compruebe también que está utilizando la API y " +"las claves secretas correctas y una dirección de envío válida desde su cuenta de " +"Mailjet" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "" + +#: src/includes/MailjetMail.php:131 +#, php-format +msgid "" +"Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s" +msgstr "" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 +#: src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "Conectar su cuenta de Mailjet para empezar" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 +#: src/includes/SettingsPages/ConnectAccountSettings.php:132 +#: src/includes/SettingsPages/Dashboard.php:72 +#: src/includes/SettingsPages/EnableSendingSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:163 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "Ajustes" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "Vea y administre sus listas de contactos" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "Listas" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "Campañas" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "Vea las estadísticas de su campaña" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "Estadísticas" + +#: src/includes/MailjetMenu.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "Configurar sus listas" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "¡Ya está todo listo!" + +#: src/includes/MailjetMenu.php:91 src/includes/SettingsPages/Dashboard.php:39 +#: src/includes/SettingsPages/InitialContactListsSettings.php:240 +#: src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "Bienvenido al plugin de Mailjet para Wordpress" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 +#: src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 +#: src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key associated to " +"your Mailjet account: https://app." +"mailjet.com/account/api_keys" +msgstr "" +"Por favor asegúrese de que está utilizando la clave API y la clave secreta correcta " +"asociadas a su cuenta Mailjet: https://app.mailjet.com/account/api_keys" + +#: src/includes/MailjetSettings.php:179 +msgid "" +"Your Mailjet API credentials are invalid or not yet configured. Please check and " +"configure them to proceed further." +msgstr "" + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "¿Qué le gustaría hacer a continuación?" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "Añadir un formulario de suscripción a su sitio web" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "" +"Go to the widget management page and add the Mailjet Subscription Widget to your " +"website to start collecting email addresses." +msgstr "" +"Vaya a la página de administración de widgets y añada el Widget de suscripción a " +"Mailjet a su sitio web para empezar a recopilar direcciones de correo electrónico." + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "Administrar mis widgets" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "Enviar una campaña por correo electrónico" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns and click " +"on \"Create a campaign\" to create and send your email." +msgstr "" +"¿Está listo para enviar un boletín a sus suscriptores? Simplemente vaya a sus campañas " +"y haga clic en \"Crear una campaña\" para crear y enviar su correo electrónico." + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "Crear una campaña" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "Configurar el envío de correo electrónico de Wordpress" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "" +"Enable and configure sending of all your Wordpress emails (transactional emails, " +"etc...) through Mailjet." +msgstr "" +"Habilite y configure el envío de todos sus correos electrónicos de Wordpress (correos " +"transaccionales, etc...) a través de Mailjet." + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "Configurar" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, php-format +msgid "or Go to your Mailjet Plugin Homepage" +msgstr "" +"o Ir a la página de inicio de Mailjet Plugin" + +#: src/includes/SettingsPages/AllSetup.php:71 +#: src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 +#: src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 +#: src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 +#: src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 +#: src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "¿Necesita ayuda?" + +#: src/includes/SettingsPages/AllSetup.php:73 +#: src/includes/SettingsPages/ConnectAccountSettings.php:167 +#: src/includes/SettingsPages/Dashboard.php:83 +#: src/includes/SettingsPages/EnableSendingSettings.php:258 +#: src/includes/SettingsPages/InitialContactListsSettings.php:278 +#: src/includes/SettingsPages/InitialSettings.php:222 +#: src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 +#: src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "Acceder a la guía" + +#: src/includes/SettingsPages/AllSetup.php:74 +#: src/includes/SettingsPages/ConnectAccountSettings.php:168 +#: src/includes/SettingsPages/Dashboard.php:84 +#: src/includes/SettingsPages/EnableSendingSettings.php:259 +#: src/includes/SettingsPages/InitialContactListsSettings.php:279 +#: src/includes/SettingsPages/InitialSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 +#: src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "Contactar con nuestro equipo de asistencia" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and paste your " +"credentials bellow" +msgstr "" +"Vaya a Mi cuenta > Claves de API y pegue sus credenciales a continuación" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 +#: src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "Clave de API" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 +#: src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "Su clave API" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 +#: src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "Clave Secreta" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 +#: src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "Su clave Secreta" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 +#: src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 +#: src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 +#: src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "Se han guardado tus cambios" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 +#: src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "Volver al panel de control" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 +#: src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 +#: src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 +#: src/includes/SettingsPages/UserAccessSettings.php:159 src/widget/views/admin.php:202 +#: src/widget/views/admin.php:497 +msgid "Save" +msgstr "Guardar" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 +#: src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 +#: src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 +#: src/includes/SettingsPages/UserAccessSettings.php:162 src/widget/views/admin.php:203 +#: src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "Cancelar" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "Envíe boletines de noticias" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "Cree y gestione sus boletines informativos. Vea las estadísticas de su campaña." + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "Mis campañas" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "Administrar mis contactos" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "Vea y administre sus listas de contactos" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "Mis listas de contactos" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "Añada un formulario de suscripción" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "Personalice un formulario de suscripción y añádalo a su sitio web de Wordpress" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "Mis widgets" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "Ver estadísticas" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "Ver sus estadísticas de envío durante un período de tiempo" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "Mis estadísticas" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "Actualice los ajustes" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "Revise y modifique la configuración de sus plugins" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "Enable or disable the sending of your emails through your Mailjet account" +msgstr "" +"Habilite o deshabilite el envío de sus correos electrónicos a través de su cuenta " +"Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "Habilite el envío de correos electrónicos a través de Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "De: Nombre" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "p. ej. Jenny Ford" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "Origen: name@email.com" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "Puerto a utilizar para la comunicación SMTP" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "Habilite la comunicación SSL con mailjet.com (sólo disponible con el puerto 465)" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "Enviar una prueba" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "Destinatario del correo electrónico de prueba" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "Enviar" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 +#: src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "Habilite el envío de correos electrónicos a través de Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "" +"Can not connect to Mailjet with the selected settings. Check if a firewall is blocking " +"connections to the Mailjet ports." +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +msgid "Please provide a valid email address" +msgstr "Introduce una dirección de email válida" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't block the SMTP " +"ports. Also double check that you are using correct API and Secret keys and a valid " +"sending address from your Mailjet account." +msgstr "" +"No se pudo enviar el correo electrónico de prueba. Por favor, asegúrese de que su " +"servidor no bloquee los puertos SMTP. Compruebe también que está utilizando la API y " +"las claves secretas correctas y una dirección de envío válida desde su cuenta de " +"Mailjet." + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "Su correo electrónico ha sido probado enviado con éxito" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +msgid "" +"Your settings have been saved, but your port and SSL settings were changed to ensure " +"delivery" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You can add your " +"Wordpress subscribers to one of them, or use them to collect new email addresses." +msgstr "" +"Estas son las listas de contactos que hemos detectado en su cuenta de Mailjet. Puede " +"agregar sus usuarios de Wordpress a una de ellas, o utilizarlas para recopilar nuevas " +"direcciones de correo electrónico." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "Sus listas de contactos de Mailjet" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +msgid "contact" +msgstr "contacto" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "contactos" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "Crear una nueva lista" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "Poner un nombre a su lista (máximo de 50 caracteres)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "Sincronizar sus usuarios de Wordpress" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "" +"If you wish, you can add your Wordpress website users (readers, authors, " +"administrators, …) to a contact list." +msgstr "" +"Si lo desea, puede añadir los usuarios de su sitio web Wordpress (lectores, autores, " +"administradores,...) a una lista de contactos." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 +#: src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "Añadir automáticamente usuarios de Wordpress a una lista específica" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "Automatically add all my future Wordpress subscribers to a specific contact list" +msgstr "" +"Añadir automáticamente todos mis futuros usuarios de Wordpress a la siguiente lista" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "Also, add existing %s Wordpress users (initial synchronization)" +msgstr "" +"Además, agregar los %s usuarios existentes de Wordpress%s already exists" +msgstr "" +"El nombre de la propiedad está vacía o inválida - %s . Por favor, inténtelo de " +"nuevo" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 +#: src/includes/SettingsPages/InitialSettings.php:168 +msgid "" +"Mailjet is an email service provider. With this plugin, easily send newsletters to " +"your website users, directly from Wordpress." +msgstr "" +"Mailjet es un proveedor de servicios de correo electrónico. Con este plugin, envíe " +"fácilmente boletines de noticias o newsletters a los usuarios de su sitio web, " +"directamente desde Wordpress." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "Aplicar y continuar" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "Omitir este paso" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "Siguiente" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 +#: src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "¿Necesita ayuda para empezar?" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My Account > API Keys and paste " +"your credentials below" +msgstr "" +"Vaya a Mi cuenta > Claves de API y pegue sus credenciales a continuación" + +#: src/includes/SettingsPages/InitialSettings.php:182 +msgid "Connect your account" +msgstr "Conecte su cuenta de Mailjet" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "¿Aún no tiene una cuenta Mailjet?" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "Abra una cuenta" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "Recopila direcciones de correo electrónico…" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "Las direcciones de correo electrónico se recopilan en su sitio web" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "... y añadido a su lista de contactos de Mailjet" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "Email are added to your contact list" +msgstr "El correo electrónico se ha añadido a tu lista de contactos" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "Nos encargaremos de enviar tus boletines de noticias" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "" +"Easily create and send newsletters to your subscribers from Wordpress. Mailjet will " +"deliver them!" +msgstr "" +"Crear y enviar fácilmente boletines de noticias a sus suscriptores desde Wordpress. " +"¡Mailjet los entregará!" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 +#: src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "" +"Select which Wordpress user roles (in addition to Administrator) will also have access " +"to the Mailjet Plugin" +msgstr "" +"Seleccionar qué roles de usuario de Wordpress (además de Administrador) también " +"tendrán acceso al Plugin de Mailjet" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "Activar la integración WooCommerce" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +msgid "" +"Display \"Subscribe to our newsletter\" checkbox in the checkout page and add " +"subscibers to this list" +msgstr "" +"Mostrar la opción de marcado “Suscríbete a nuestra newsletter” en la página de pago y " +"añadir a los suscritos a esta lista" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +msgid "" +"The settings could not be saved. Please select a contact list to subscribe WooCommerce " +"users to." +msgstr "" +"No se han podido guardar los ajustes. Por favor, inténtelo de nuevo o, en caso de que " +"el problema persista, póngase en contacto con el servicio de asistencia técnica de " +"Mailjet." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "" +"Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" form to " +"allow comment authors to join a specific contact list" +msgstr "" +"Mostrar la casilla de verificación \"Suscríbase a nuestra lista de correo\" en el " +"formulario \"Deje una respuesta\", para permitir a los autores de comentarios unirse a " +"una lista de contactos específica" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "Opciones de suscripción" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "Por favor seleccione una lista de contactos." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "" +"Something went wrong with adding existing Wordpress users to your Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "All Wordpress users were successfully added to your Mailjet contact list" +msgstr "" +"Todos los usuarios de WordPress se han añadido correctamente a tu lista de contactos " +"de Mailjet" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +msgid "Subscribe to our newsletter" +msgstr "Sí, quiero suscribirme a esta lista" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "Por favor, confirme su suscripción" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "" +"To receive newsletters from %s please confirm your subscription by clicking the " +"following button:" +msgstr "" +"Para recibir boletines de %s, por favor confirme su suscripción haciendo clic en el " +"siguiente botón:" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "Sí, quiero suscribirme a esta lista" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, simply " +"ignore this message." +msgstr "" +"Si usted recibió este correo electrónico por error o no desea suscribirse más, " +"simplemente ignore este correo electrónico." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "Confirmación de suscripción" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 +#: src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "Acceso de usuarios" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "Administrador" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "Editor" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "Autor" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "Colaborador" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "Suscriptor" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "Se han guardado tus cambios" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "Permite que tus visitantes se suscriban a una de tus listas" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "Widget de suscripción a Mailjet" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "Inglés" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "Francés" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "Alemán" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "Español" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "Italiano" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "su@email.com" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "Suscrito" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "" +"Subscription confirmation email sent. Please check your inbox and confirm your " +"subscription." +msgstr "" +"Envío de correo electrónico de confirmación de suscripción. Por favor, compruebe su " +"bandeja de entrada y confirme su suscripción." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "Su suscripción ha sido confirmada con éxito." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "Por favor proporcione una dirección de correo electrónico" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "Esta dirección de correo electrónico ya ha sido suscrita." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "El valor que ha introducido no tiene el formato correcto." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "A technical issue has prevented your subscription. Please try again later." +msgstr "" +"Un problema técnico ha impedido su suscripción. Por favor, inténtelo de nuevo más " +"tarde." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, simply " +"ignore this message" +msgstr "" +"Si usted recibió este correo electrónico por error o no desea suscribirse más, " +"simplemente ignore este correo electrónico" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "Elija los idiomas admitidos en su formulario de suscripción:" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "Título del formulario:" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "Suscríbase para recibir el boletín de noticias" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "Agregar direcciones de correo electrónico a:" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "Escoger una lista" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "Personalización avanzada de formularios" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and customize " +"the labels, error messages and confirmation email wordings." +msgstr "" +"Añada más campos a su formulario (ej: Nombre, Apellido, Fecha de nacimiento...) y " +"personalice las etiquetas, los mensajes de error y la redacción del correo electrónico " +"de confirmación." + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "Personalice su formulario de suscripción" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "Campos del formulario" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "Mensajes de validación de los formularios" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "Confirmación del Contenido del correo electrónico" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "Página de \"Gracias\"" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "Puede añadir hasta 5 propiedades de contacto para recopilar datos adicionales:" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "Propiedad" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "Seleccionar una propiedad de contacto" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "Crear nuevo" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "Nombre de su propiedad (sin espacios)" + +#: src/widget/views/admin.php:184 +msgid "Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " +msgstr "Caracteres no permitidos: espacio , * + - / \" ' : [ ] ( ) > < = ; $ " + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "Tipo de propiedad" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "Opcional" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "Obligatorio" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "Oculto" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "" +"Personalizar el texto del marcador de posición para el campo de dirección de correo " +"electrónico:" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "Texto del marcador de posición del campo de dirección de correo electrónico" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "Personalice la etiqueta del botón de envío:" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "Etiqueta del botón" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as they interact " +"with the subscription form. Leave empty fields to use the default values." +msgstr "" +"Puede personalizar los mensajes de error y éxito que se muestran a sus usuarios " +"mientras interactúan con el formulario de suscripción. Deje campos vacíos para " +"utilizar los valores por defecto." + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "Descripción" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "Formulario enviado con éxito" + +#: src/widget/views/admin.php:306 +msgid "" +"Subscription confirmed (displayed after the user has clicked the confirmation email)" +msgstr "" +"Suscripción confirmada (se muestra después de que el usuario haya hecho clic en el " +"correo electrónico de confirmación)" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "Error: el campo email está vacío" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "Error: la dirección de correo electrónico ya está suscrita" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "Error: Formato de datos no válido (esto se aplica sólo a números y fechas)" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "Mensaje de error técnico genérico" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a button they " +"need to click on to confirm their subscription. You can customize the text of the " +"confirmation email if you wish. Leave empty fields to use the default values." +msgstr "" +"Cuando un usuario rellene el formulario, recibirá un correo electrónico con un botón " +"en el que deberá hacer clic para confirmar su suscripción. Puede personalizar el texto " +"del correo electrónico de confirmación si lo desea. Deje campos vacíos para utilizar " +"los valores por defecto." + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "Asunto del correo electrónico" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "Contenido del correo electrónico: título" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "Contenido del correo electrónico: texto principal" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "Contenido del correo electrónico: etiqueta del botón de confirmación" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "Contenido del correo electrónico: texto después del botón" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful subscription " +"confirmation or leave empty to use the default \"Thank you\" page" +msgstr "" +"Seleccione una página de su sitio de Wordpress para mostrarla después de la " +"confirmación de la suscripción o déjela vacía para usar la página predeterminada " +"\"Gracias\"" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "" + +msgid "language_checkbox" +msgstr "" + +msgid "title" +msgstr "" + +msgid "list" +msgstr "0" + +msgid "language_mandatory_email" +msgstr "" + +msgid "language_mandatory_button" +msgstr "" + +msgid "contactProperties0" +msgstr "" + +msgid "propertyDataType0" +msgstr "0" + +msgid "EnglishLabel0" +msgstr "" + +msgid "FrenchLabel0" +msgstr "" + +msgid "GermanLabel0" +msgstr "" + +msgid "SpanishLabel0" +msgstr "" + +msgid "ItalianLabel0" +msgstr "" + +msgid "contactProperties1" +msgstr "" + +msgid "propertyDataType1" +msgstr "0" + +msgid "EnglishLabel1" +msgstr "" + +msgid "FrenchLabel1" +msgstr "" + +msgid "GermanLabel1" +msgstr "" + +msgid "SpanishLabel1" +msgstr "" + +msgid "ItalianLabel1" +msgstr "" + +msgid "contactProperties2" +msgstr "" + +msgid "propertyDataType2" +msgstr "0" + +msgid "EnglishLabel2" +msgstr "" + +msgid "FrenchLabel2" +msgstr "" + +msgid "GermanLabel2" +msgstr "" + +msgid "SpanishLabel2" +msgstr "" + +msgid "ItalianLabel2" +msgstr "" + +msgid "contactProperties3" +msgstr "" + +msgid "propertyDataType3" +msgstr "0" + +msgid "EnglishLabel3" +msgstr "" + +msgid "FrenchLabel3" +msgstr "" + +msgid "GermanLabel3" +msgstr "" + +msgid "SpanishLabel3" +msgstr "" + +msgid "ItalianLabel3" +msgstr "" + +msgid "contactProperties4" +msgstr "" + +msgid "propertyDataType4" +msgstr "0" + +msgid "EnglishLabel4" +msgstr "" + +msgid "FrenchLabel4" +msgstr "" + +msgid "GermanLabel4" +msgstr "" + +msgid "SpanishLabel4" +msgstr "" + +msgid "ItalianLabel4" +msgstr "" + +msgid "confirmation_email_message_input" +msgstr "" + +msgid "subscription_confirmed_message_input" +msgstr "" + +msgid "empty_email_message_input" +msgstr "" + +msgid "already_subscribed_message_input" +msgstr "" + +msgid "invalid_data_format_message_input" +msgstr "" + +msgid "generic_technical_error_message_input" +msgstr "" + +msgid "email_subject" +msgstr "" + +msgid "email_content_title" +msgstr "" + +msgid "email_content_main_text" +msgstr "" + +msgid "email_content_confirm_button" +msgstr "" + +msgid "email_content_after_button" +msgstr "" + +#~ msgid "You have been successfully subscribed to a Mailjet contact list" +#~ msgstr "¡Se ha suscrito correctamente" + +#~ msgid "" +#~ "Subscription confirmation email sent. Please check your inbox and confirm the " +#~ "subscription." +#~ msgstr "" +#~ "Envío de correo electrónico de confirmación de suscripción. Por favor, compruebe su " +#~ "bandeja de entrada y confirme su suscripción." + +#~ msgid "Newsletter Registration" +#~ msgstr "Registro de boletines" + +#~ msgid "Congratulations, you have successfully subscribed!" +#~ msgstr "Enhorabuena, te has suscrito correctamente!" + +#~ msgid "Contacts" +#~ msgstr "Contactos" + +#~ msgid "Name your list" +#~ msgstr "Poner un nombre a su lista" + +#~ msgid "Mailjet plugin for Wordpress" +#~ msgstr "Plugin de Mailjet para Wordpress" + +#~ msgid "The Matrix has you." +#~ msgstr "Une de Matrixe muy bien" diff --git a/languages/wp-mailjet-fr_FR.mo b/languages/wp-mailjet-fr_FR.mo new file mode 100644 index 00000000..288fb291 Binary files /dev/null and b/languages/wp-mailjet-fr_FR.mo differ diff --git a/languages/wp-mailjet-fr_FR.po b/languages/wp-mailjet-fr_FR.po new file mode 100644 index 00000000..da23364c --- /dev/null +++ b/languages/wp-mailjet-fr_FR.po @@ -0,0 +1,1153 @@ +msgid "" +msgstr "" +"Project-Id-Version: Mailjet plugin\n" +"POT-Creation-Date: 2018-12-03 11:08+0200\n" +"PO-Revision-Date: 2019-01-17 15:46+0200\n" +"Last-Translator: \n" +"Language-Team: Ferhan Ismailov \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;" +"esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 src/includes/MailjetMenu.php:97 +#: src/includes/SettingsPages/AllSetup.php:70 src/includes/SettingsPages/ConnectAccountSettings.php:143 +#: src/includes/SettingsPages/Dashboard.php:80 src/includes/SettingsPages/InitialContactListsSettings.php:275 +#: src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "Connecter votre compte Mailjet" + +#: src/admin/partials/MailjetAdminDisplay.php:36 src/includes/MailjetMenu.php:100 +#: src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "Paramètres d'envoi" + +#: src/admin/partials/MailjetAdminDisplay.php:45 src/includes/MailjetMenu.php:103 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "Options d'inscription" + +#: src/admin/partials/MailjetAdminDisplay.php:54 src/includes/MailjetMenu.php:106 +#: src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "Accès utilisateur" + +#: src/admin/partials/MailjetAdminDisplay.php:63 src/includes/MailjetMenu.php:109 +#: src/includes/SettingsPages/IntegrationsSettings.php:116 src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "Intégrations" + +#: src/includes/MailjetMail.php:116 +msgid "Email sending failed. Please review your smtp configuration and try again later" +msgstr "" +"L'email test n'a pas pu être envoyé. Veuillez vous assurer que le serveur ne bloquent pas les ports SMTP. " +"Egalement, vérifiez bien que vous utilisez la bonne API et les clés secrètes et une adresse d'envoi valide depuis " +"votre compte Mailjet" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "Votre email de test" + +#: src/includes/MailjetMail.php:131 +#, php-format +msgid "Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s" +msgstr "" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "Connecter votre compte Mailjet pour commencer" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 +#: src/includes/SettingsPages/ConnectAccountSettings.php:132 src/includes/SettingsPages/Dashboard.php:72 +#: src/includes/SettingsPages/EnableSendingSettings.php:223 src/includes/SettingsPages/IntegrationsSettings.php:163 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "Paramètres" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "Gérer les campagnes" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "Campagnes" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "Consulter les statistiques" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "Statistiques" + +#: src/includes/MailjetMenu.php:80 src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "Configurez vos listes" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "Vous êtes prêts !" + +#: src/includes/MailjetMenu.php:91 src/includes/SettingsPages/Dashboard.php:39 +#: src/includes/SettingsPages/InitialContactListsSettings.php:240 src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "Bienvenue dans le plugin Mailjet pour WordPress" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys" +msgstr "" +"Veuillez vous assurer que vous utilisez une API et la clé secrète associés à votre compte Mailjet : https://app.mailjet.com/account/api_keys" + +#: src/includes/MailjetSettings.php:179 +msgid "" +"Your Mailjet API credentials are invalid or not yet configured. Please check and configure them to proceed further." +msgstr "" + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "Que souhaitez-vous vous faire à présent ?" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "Ajoutez un formulaire de souscription à votre site Web" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "" +"Go to the widget management page and add the Mailjet Subscription Widget to your website to start collecting email " +"addresses." +msgstr "" +"Rendez-vous sur la page de gestion des widgets et ajoutez le widget d'inscription de Mailjet à votre site Web pour " +"commencer à collecter des adresses email." + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "Gérer les widgets" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "Envoyer une campagne email" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns and click on \"Create a campaign\" to " +"create and send your email." +msgstr "" +"Prêt à envoyer une newsletter à vos inscrits ? Rendez-vous simplement sur vos campagnes et cliquez sur \"Créer une " +"campagne\" pour la créer et envoyer un email." + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "Créer une campagne" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "Configurer l'envoi d'email WordPress" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "Enable and configure sending of all your Wordpress emails (transactional emails, etc...) through Mailjet." +msgstr "Autoriser et configurer l'envoie de tous les emails de WordPress (emails transactionnels, etc.) via Mailjet." + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "Configurer" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, php-format +msgid "or Go to your Mailjet Plugin Homepage" +msgstr "ou Rendez-vous sur la page de plugin Mailjet" + +#: src/includes/SettingsPages/AllSetup.php:71 src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "Besoin d'aide ?" + +#: src/includes/SettingsPages/AllSetup.php:73 src/includes/SettingsPages/ConnectAccountSettings.php:167 +#: src/includes/SettingsPages/Dashboard.php:83 src/includes/SettingsPages/EnableSendingSettings.php:258 +#: src/includes/SettingsPages/InitialContactListsSettings.php:278 src/includes/SettingsPages/InitialSettings.php:222 +#: src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 +#: src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "Accéder au guide" + +#: src/includes/SettingsPages/AllSetup.php:74 src/includes/SettingsPages/ConnectAccountSettings.php:168 +#: src/includes/SettingsPages/Dashboard.php:84 src/includes/SettingsPages/EnableSendingSettings.php:259 +#: src/includes/SettingsPages/InitialContactListsSettings.php:279 src/includes/SettingsPages/InitialSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 +#: src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "Contacter notre équipe de support" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and paste your credentials bellow" +msgstr "" +"Dans votre compte Mailjet, allez dans Mon compte > Clés API et coller vos crédits ci-dessous" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "Clé API" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "Votre clé API" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "Clé secrète" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "Votre clé secrète" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "Vos modifications ont été enregistrées" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "Retour au tableau de bord" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 +#: src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 +#: src/includes/SettingsPages/UserAccessSettings.php:159 src/widget/views/admin.php:202 +#: src/widget/views/admin.php:497 +msgid "Save" +msgstr "Enregistrer" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 +#: src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 +#: src/includes/SettingsPages/UserAccessSettings.php:162 src/widget/views/admin.php:203 +#: src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "Annuler" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "Envoyer des newsletters" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "Créer et gérer vos newsletters. Consulter les statistiques de votre campagne." + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "Mes campagnes" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "Gérer mes contacts" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "Consulter et gérer vos listes de contacts" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "Mes listes de contacts" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "Ajouter un formulaire d'inscription" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "Personnalisez votre formulaire de souscription et ajoutez-le à votre site Web WordPress" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "Mes widgets" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "Voir les statistiques" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "Consulter vos statistiques sur une période" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "Mes statistiques" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "Mettre à jour les paramètres" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "Réviser et modifier vos paramètres de plugin" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "Enable or disable the sending of your emails through your Mailjet account" +msgstr "Autoriser ou interdire l'envoi de vos emails par le compte Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "Autoriser les emails d'envoi via Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "Depuis : Nom" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "ex : Jenny Ford" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "Depuis : nom@email.com" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "Port pour utiliser une communication SMTP" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "Permettre une communication SSL avec mailjet.com (seulement disponible avec port 465)" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "Envoyer un test" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "Destinataire de votre email" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "Envoi" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 +#: src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "Autoriser les emails d'envoi via Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "" +"Can not connect to Mailjet with the selected settings. Check if a firewall is blocking connections to the Mailjet " +"ports." +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +msgid "Please provide a valid email address" +msgstr "Veuillez saisir une adresse email valide" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't block the SMTP ports. Also double check " +"that you are using correct API and Secret keys and a valid sending address from your Mailjet account." +msgstr "" +"L'email test n'a pas pu être envoyé. Veuillez vous assurer que le serveur ne bloquent pas les ports SMTP. " +"Egalement, vérifiez bien que vous utilisez la bonne API et les clés secrètes et une adresse d'envoi valide depuis " +"votre compte Mailjet." + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "Votre email de test a bien été envoyé" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +msgid "Your settings have been saved, but your port and SSL settings were changed to ensure delivery" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You can add your Wordpress subscribers to one " +"of them, or use them to collect new email addresses." +msgstr "" +"Voici les listes de contact que nous avons détecté sur votre compte Mailjet. Vous pouvez ajouter vos utilisateurs " +"WordPress à l'une d'entre elles ou utilisez-les pour collecter de nouvelles adresses email." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "Vos listes de contacts Mailjet" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +msgid "contact" +msgstr "contact" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "contacts" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "Créer une nouvelle liste" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "Nommez votre liste (50 caractères maximum)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "Synchroniser vos utilisateurs WordPress" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "" +"If you wish, you can add your Wordpress website users (readers, authors, administrators, …) to a contact list." +msgstr "" +"Si vous le souhaitez, vous pouvez ajouter vos utilisateurs de site WordPress (lecteurs, auteurs, administrateur…) " +"à une liste de contacts." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 +#: src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "Ajoutez automatiquement les utilisateurs de Wordpress à une liste spécifique" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "Automatically add all my future Wordpress subscribers to a specific contact list" +msgstr "Ajoutez automatiquement tous mes futurs utilisateurs WordPress à la liste suivante" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "Also, add existing %s Wordpress users (initial synchronization)" +msgstr "Egalement, ajouter les %s utilisateurs Wordpress existants (synchronisation initiale)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:180 +#: src/includes/SettingsPages/InitialContactListsSettings.php:201 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:159 +msgid "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." +msgstr "" +"Les paramètres peuvent être sauvegardés. Veuillez essayer de nouveau ou si le problème persiste, contactez le " +"support de Mailjet." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:190 +msgid "Congratulations! You have just created a new contact list!" +msgstr "Félicitations! Vous venez tout juste de créer une nouvelle liste de contacts!" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:196 +#, php-format +msgid "A contact list with name %s already exists" +msgstr "Ce nom %s est déjà utilisé pour une autre liste de contacts. Veuillez réessayer" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 src/includes/SettingsPages/InitialSettings.php:168 +msgid "" +"Mailjet is an email service provider. With this plugin, easily send newsletters to your website users, directly " +"from Wordpress." +msgstr "" +"Mailjet est un fournisseur de service email. Avec ce plugin, vous pouvez envoyer facilement les newsletters à vos " +"utilisateurs de site Web, directement depuis WordPress." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "Appliquer & Continuer" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "Passez cette étape" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "Suivant" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "Besoin d'aide pour vous lancer?" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My Account > API Keys and paste your credentials below" +msgstr "" +"Aller dans Mon compte > " +"Clés API et copier les crédits ci-dessous" + +#: src/includes/SettingsPages/InitialSettings.php:182 +msgid "Connect your account" +msgstr "Connecter votre compte Mailjet" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "Vous n'avez pas encore de compte Mailjet ?" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "Créer un compte" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "Collecter des adresses e-mail..." + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "Les adresses emails sont envoyés depuis votre site Internet" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "…et ajouter à votre liste de contacts de Mailjet" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "Email are added to your contact list" +msgstr "Les adresses email sont ajoutées à votre liste de contacts" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "Nous nous chargerons de l'envoi de vos newsletters" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "Easily create and send newsletters to your subscribers from Wordpress. Mailjet will deliver them!" +msgstr "Créer facilement et envoyez des newsletters à vos inscrits depuis WordPress. Mailjet les enverra !" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "Select which Wordpress user roles (in addition to Administrator) will also have access to the Mailjet Plugin" +msgstr "" +"Sélectionner quels rôles les utilisateurs administrateurs Wordpress (en plus de l'Administrateur) auront également " +"accès au Plugin Mailjet" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "Activer l'intégration WooCommerce" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +msgid "Display \"Subscribe to our newsletter\" checkbox in the checkout page and add subscibers to this list" +msgstr "" +"Afficher la case à cocher \"S'inscrire à notre newsletter\" sur la page de paiement et ajouter les abonnés à cette " +"liste" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +#, fuzzy +#| msgid "The settings could not be saved. Please try again or in case the problem persists contact Mailjet support." +msgid "The settings could not be saved. Please select a contact list to subscribe WooCommerce users to." +msgstr "" +"Les paramètres peuvent être sauvegardés. Veuillez essayer de nouveau ou si le problème persiste, contactez le " +"support de Mailjet." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "" +"Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" form to allow comment authors to join " +"a specific contact list" +msgstr "" +"Affichez \"Inscrivez-vous à la liste mailing\" dans le formulaire \"Laissez un commentaire\" pour permettre aux " +"auteurs de commentaires de rejoindre une liste de contact spécifique" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "Options d'inscription" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "Merci de séléctionner une liste de contacts." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "Something went wrong with adding existing Wordpress users to your Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "All Wordpress users were successfully added to your Mailjet contact list" +msgstr "Tous les utilisateurs de Wordpress ont été ajoutés avec succès à votre liste de contacts Mailjet" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +msgid "Subscribe to our newsletter" +msgstr "Oui, abonnez-moi à cette liste" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "Confirmez votre abonnement" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "To receive newsletters from %s please confirm your subscription by clicking the following button:" +msgstr "Pour recevoir la newsletter de %s veuillez confirmer votre abonnement en cliquant sur le bouton suivant :" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "Oui, abonnez-moi à cette liste" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message." +msgstr "" +"Si vous recevez cet email par erreur ou si vous ne souhaitez plus vous abonner, ignorer simplement cet email." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "Confirmation d'inscription" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "Accès utilisateurs" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "Administrateur" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "Éditeur" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "Auteur" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "Contributeur" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "Abonné" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "Vos modifications ont été enregistrées" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "Permet à vos visiteurs de s'abonner à l'une de vos listes" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "Widget d'inscription Mailjet" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "Anglais" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "Français" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "Allemand" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "Espagnol" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "Italien" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "votre@email.com" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "M'abonner" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "Subscription confirmation email sent. Please check your inbox and confirm your subscription." +msgstr "" +"Email de confirmation d'inscription envoyé. Veuillez vérifier votre boîte mail et confirmez votre inscription." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "Votre inscription a été confirmée avec succès." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "Veuilez fournir une adresse email" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "Cette adresse email a déjà été enregistrée." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "La valeur entrée n'est pas au bon format." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "A technical issue has prevented your subscription. Please try again later." +msgstr "Un problème tehcnique a empêché votre inscription. Veuillez rééssayer plus tard." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message" +msgstr "Si vous recevez cet email par erreur ou si vous ne souhaitez plus vous abonner, ignorer simplement cet email" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "Choississez les langues acceptées dans notre formulaire d'inscription:" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "Titre du formulaire:" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "Inscrivez-vous pour recevoir la newsletter" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "Ajouter l'adresse email pour :" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "Choisir une liste" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "Personnalisation de formulaire avancé" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and customize the labels, error messages and " +"confirmation email wordings." +msgstr "" +"Ajoutez plus de champs à votre formulaire (ex: Prénom, Nom, Anniversaire...) et personnalisez les étiquettes, " +"messages." + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "Personnalisez votre formulaire d'inscription" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "Champs de formulaire" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "Messages de validation de formulaire" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "Contenu d'email de confirmation" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "Page de \"Merci\"" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "Vous pouvez ajouter jusqu'à 5 propriété de contacts pour collecter des données supplémentaires:" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "Propriété" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "Propriété" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "Sélectionnez une propriété de contact" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "Créer un nouveau" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "Nommez votre propriété" + +#: src/widget/views/admin.php:184 +msgid "Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " +msgstr "Caractères non tolérés: espace , * + - / \" ' : [ ] ( ) > < = ; $ " + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "Type de propriété" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "Optionnel" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "Obligatoire" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "Caché" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "Personnalisez le texte de l'espace réserver pour le champ d'adresse email :" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "Texte de l'espace réservé à l'adresse email" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "Personnaliser l'étiquette de bouton de soumission:" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "Etiquette de bouton" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as they interact with the subscription form. " +"Leave empty fields to use the default values." +msgstr "" +"Vous pouvez personnaliser les messages d'erreur et de succès affichés à vos utilisateurs lorsqu'ils intéragissent " +"avec le formuaire d'inscription. Laissez les champs vides afin d'utiliser les valeurs par défaut." + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "Description" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "Formulaire soumis avec succès" + +#: src/widget/views/admin.php:306 +msgid "Subscription confirmed (displayed after the user has clicked the confirmation email)" +msgstr "Inscription confirmée (affichée après le clc de l'utilisateur sur l'email de confirmation)" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "Erreur : le champ erreur est vide" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "Erreur : l'adresse email est déjà inscrite" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "Erreur : format de données invalide (seulement applicable pour les nombres et les dates)" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "Message d'erreur technique générique" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a button they need to click on to confirm " +"their subscription. You can customize the text of the confirmation email if you wish. Leave empty fields to use " +"the default values." +msgstr "" +"Lorsqu'un utilisateur remplit le formulaire, ils recevront un email contenant un bouton à cliquer pour confirmer " +"leur inscription. Vous pouvez personnaliser le texte de l'emai de confirmation si vous le souhaitez. Laissez des " +"champs vides pour utiliser les valeurs par défaut." + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "Sujet de l'email" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "Contenu de l'email : titre" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "Contenu de l'email : texte principal" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "Contenu de l'email : etiquette de bouton de confirmation" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "Contenu de l'email: texte après le bouton" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful subscription confirmation or leave empty to use " +"the default \"Thank you\" page" +msgstr "" +"Sélectionnez une page dans votre site Wordpress pour montrer une confirmation d'inscription avec succès ou laissez " +"vide afin d'utiliser la page \"Merci\" par défaut" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "" + +msgid "language_checkbox" +msgstr "" + +msgid "title" +msgstr "" + +msgid "list" +msgstr "0" + +msgid "language_mandatory_email" +msgstr "" + +msgid "language_mandatory_button" +msgstr "" + +msgid "contactProperties0" +msgstr "" + +msgid "propertyDataType0" +msgstr "0" + +msgid "EnglishLabel0" +msgstr "" + +msgid "FrenchLabel0" +msgstr "" + +msgid "GermanLabel0" +msgstr "" + +msgid "SpanishLabel0" +msgstr "" + +msgid "ItalianLabel0" +msgstr "" + +msgid "contactProperties1" +msgstr "" + +msgid "propertyDataType1" +msgstr "0" + +msgid "EnglishLabel1" +msgstr "" + +msgid "FrenchLabel1" +msgstr "" + +msgid "GermanLabel1" +msgstr "" + +msgid "SpanishLabel1" +msgstr "" + +msgid "ItalianLabel1" +msgstr "" + +msgid "contactProperties2" +msgstr "" + +msgid "propertyDataType2" +msgstr "0" + +msgid "EnglishLabel2" +msgstr "" + +msgid "FrenchLabel2" +msgstr "" + +msgid "GermanLabel2" +msgstr "" + +msgid "SpanishLabel2" +msgstr "" + +msgid "ItalianLabel2" +msgstr "" + +msgid "contactProperties3" +msgstr "" + +msgid "propertyDataType3" +msgstr "0" + +msgid "EnglishLabel3" +msgstr "" + +msgid "FrenchLabel3" +msgstr "" + +msgid "GermanLabel3" +msgstr "" + +msgid "SpanishLabel3" +msgstr "" + +msgid "ItalianLabel3" +msgstr "" + +msgid "contactProperties4" +msgstr "" + +msgid "propertyDataType4" +msgstr "0" + +msgid "EnglishLabel4" +msgstr "" + +msgid "FrenchLabel4" +msgstr "" + +msgid "GermanLabel4" +msgstr "" + +msgid "SpanishLabel4" +msgstr "" + +msgid "ItalianLabel4" +msgstr "" + +msgid "confirmation_email_message_input" +msgstr "" + +msgid "subscription_confirmed_message_input" +msgstr "" + +msgid "empty_email_message_input" +msgstr "" + +msgid "already_subscribed_message_input" +msgstr "" + +msgid "invalid_data_format_message_input" +msgstr "" + +msgid "generic_technical_error_message_input" +msgstr "" + +msgid "email_subject" +msgstr "" + +msgid "email_content_title" +msgstr "" + +msgid "email_content_main_text" +msgstr "" + +msgid "email_content_confirm_button" +msgstr "" + +msgid "email_content_after_button" +msgstr "" + +#~ msgid "You have been successfully subscribed to a Mailjet contact list" +#~ msgstr "Vous êtes inscrit avec succès" + +#~ msgid "Subscription confirmation email sent. Please check your inbox and confirm the subscription." +#~ msgstr "" +#~ "Email de confirmation d'inscription envoyé. Veuillez vérifier votre boîte mail et confirmez votre inscription." + +#~ msgid "Newsletter Registration" +#~ msgstr "Inscription à la newsletter" + +#~ msgid "Congratulations, you have successfully subscribed!" +#~ msgstr "Félicitations, vous avez souscrit avec succès!" + +#~ msgid "Contacts" +#~ msgstr "Contacts" + +#~ msgid "Name your list" +#~ msgstr "Nommez votre liste" + +#~ msgid "" +#~ "Mailjet is an email service provider. With this plugin, easily send newsletters to your contacts, directly from " +#~ "Wordpress." +#~ msgstr "" +#~ "Mailjet est un fournisseur de service email. Avec ce plugin, envoie facilement les newsletters à vos " +#~ "utilisateurs de site Web, directement depuis WordPress." + +#~ msgid "Confirm your mailing list subscription" +#~ msgstr "Confirmez votre abonnement" + +#~ msgid "

    Something awesome

    " +#~ msgstr "

    French Something awesome

    " + +#~ msgid "The Matrix has you." +#~ msgstr "La Matrixiones jeveaux le tour" + +#~ msgid "Widget Title" +#~ msgstr "La French Title" + +#~ msgid "Text:" +#~ msgstr "FR Text:" + +#~ msgid "Select" +#~ msgstr "FR Select" + +#~ msgid "Option 2" +#~ msgstr "FR Option 2" + +#~ msgid "text" +#~ msgstr "FrText" + +#~ msgid "textarea" +#~ msgstr "Fr Textarea" + +#~ msgid "checkbox" +#~ msgstr "1" + +#~ msgid "select" +#~ msgstr "option_3" diff --git a/languages/wp-mailjet-it_IT.mo b/languages/wp-mailjet-it_IT.mo new file mode 100644 index 00000000..b4cba150 Binary files /dev/null and b/languages/wp-mailjet-it_IT.mo differ diff --git a/languages/wp-mailjet-it_IT.po b/languages/wp-mailjet-it_IT.po new file mode 100644 index 00000000..1bb5df62 --- /dev/null +++ b/languages/wp-mailjet-it_IT.po @@ -0,0 +1,1224 @@ +msgid "" +msgstr "" +"Project-Id-Version: Mailjet plugin\n" +"POT-Creation-Date: 2018-12-03 11:09+0200\n" +"PO-Revision-Date: 2019-01-17 15:48+0200\n" +"Last-Translator: \n" +"Language-Team: Ferhan Ismailov \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;" +"esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;" +"__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 src/includes/MailjetMenu.php:97 +#: src/includes/SettingsPages/AllSetup.php:70 +#: src/includes/SettingsPages/ConnectAccountSettings.php:143 +#: src/includes/SettingsPages/Dashboard.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:275 +#: src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "Collega il tuo account Mailjet" + +#: src/admin/partials/MailjetAdminDisplay.php:36 src/includes/MailjetMenu.php:100 +#: src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "Impostazioni di invio" + +#: src/admin/partials/MailjetAdminDisplay.php:45 src/includes/MailjetMenu.php:103 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "Opzioni di iscrizione" + +#: src/admin/partials/MailjetAdminDisplay.php:54 src/includes/MailjetMenu.php:106 +#: src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "Accesso utente" + +#: src/admin/partials/MailjetAdminDisplay.php:63 src/includes/MailjetMenu.php:109 +#: src/includes/SettingsPages/IntegrationsSettings.php:116 +#: src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "Integrazioni" + +#: src/includes/MailjetMail.php:116 +msgid "Email sending failed. Please review your smtp configuration and try again later" +msgstr "" +"Non è stato possibile inviare l'e-mail di prova. Per favore, assicurati che il server " +"non blocchi le porte SMTP. Inoltre, controlla di nuovo che tu stia usando le corrette " +"chiavi API e segrete e un indirizzo di invio valido dal tuo account Mailjet" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "La tua email di prova" + +#: src/includes/MailjetMail.php:131 +#, php-format +msgid "" +"Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s" +msgstr "" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 +#: src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "Collega il tuo account Mailjet" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 +#: src/includes/SettingsPages/ConnectAccountSettings.php:132 +#: src/includes/SettingsPages/Dashboard.php:72 +#: src/includes/SettingsPages/EnableSendingSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:163 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "Impostazioni" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "Gestire i mie liste di contatti" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "Liste di contatti" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "Gestire i mie campagne" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "Campagne" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "Visualizzare le statistiche" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "Le statistiche" + +#: src/includes/MailjetMenu.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "Configura le tue liste" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "È tutto configurato!" + +#: src/includes/MailjetMenu.php:91 src/includes/SettingsPages/Dashboard.php:39 +#: src/includes/SettingsPages/InitialContactListsSettings.php:240 +#: src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "Benvenuto sul plugin Mailjet per Wordpress" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 +#: src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 +#: src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key associated to " +"your Mailjet account: https://app." +"mailjet.com/account/api_keys" +msgstr "" +"Assicurati di utilizzare la chiave API e la chiave segreta corretti associati al tuo " +"account Mailjet: https://app." +"mailjet.com/account/api_keys" + +#: src/includes/MailjetSettings.php:179 +msgid "" +"Your Mailjet API credentials are invalid or not yet configured. Please check and " +"configure them to proceed further." +msgstr "" + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "Cosa vorresti fare in seguito?" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "Aggiungi un modulo d'iscrizione al tuo sito web" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "" +"Go to the widget management page and add the Mailjet Subscription Widget to your " +"website to start collecting email addresses." +msgstr "" +"Vai alla pagina di gestione dei widget e aggiungi il Widget di Iscrizione Mailjet sul " +"tuo sito web per iniziare a raccogliere gli indirizzi e-mail." + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "Gestire i miei widget" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "Inviare una campagna e-mail" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your Campaigns and click " +"on \"Create a campaign\" to create and send your email." +msgstr "" +"Sei pronto per inviare una newsletter ai tuoi iscritti? Basta andare sulle tue " +"campagne e cliccare su \"Crea una campagna\" per creare e inviare la tua e-mail." + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "Crea una campagna" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "Configurare l'invio di e-mail di Wordpress" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "" +"Enable and configure sending of all your Wordpress emails (transactional emails, " +"etc...) through Mailjet." +msgstr "" +"Abilita e configura l'invio di tutte le tue e-mail Wordpress (e-mail transazionali, " +"ecc...) tramite Mailjet." + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "Configura" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, php-format +msgid "or Go to your Mailjet Plugin Homepage" +msgstr "" +"o Vai alla tua Homepage del Plugin Mailjet" + +#: src/includes/SettingsPages/AllSetup.php:71 +#: src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 +#: src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 +#: src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 +#: src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 +#: src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "Hai bisogno di aiuto?" + +#: src/includes/SettingsPages/AllSetup.php:73 +#: src/includes/SettingsPages/ConnectAccountSettings.php:167 +#: src/includes/SettingsPages/Dashboard.php:83 +#: src/includes/SettingsPages/EnableSendingSettings.php:258 +#: src/includes/SettingsPages/InitialContactListsSettings.php:278 +#: src/includes/SettingsPages/InitialSettings.php:222 +#: src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 +#: src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "Leggi la nostra guida utente" + +#: src/includes/SettingsPages/AllSetup.php:74 +#: src/includes/SettingsPages/ConnectAccountSettings.php:168 +#: src/includes/SettingsPages/Dashboard.php:84 +#: src/includes/SettingsPages/EnableSendingSettings.php:259 +#: src/includes/SettingsPages/InitialContactListsSettings.php:279 +#: src/includes/SettingsPages/InitialSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 +#: src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "Contatta il nostro servizio di assistenza" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and paste your " +"credentials bellow" +msgstr "" +"Vai su Il mio account > Chiavi API e incolla le credenziali qui sotto" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 +#: src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "Chiave API" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 +#: src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "Tua chiave API" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 +#: src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "Chiave Segreta" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 +#: src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "Tua chiave Segreta" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 +#: src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 +#: src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 +#: src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "Le modifiche sono state salvate" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 +#: src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "Torna alla pannello di controllo" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 +#: src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 +#: src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 +#: src/includes/SettingsPages/UserAccessSettings.php:159 src/widget/views/admin.php:202 +#: src/widget/views/admin.php:497 +msgid "Save" +msgstr "Salva" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 +#: src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 +#: src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 +#: src/includes/SettingsPages/UserAccessSettings.php:162 src/widget/views/admin.php:203 +#: src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "Annulla" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "Inviare newsletter" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "Crea e gestisci le tue newsletter. Visualizza le statistiche della tua campagna." + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "Le mie campagne" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "Gestire i miei contatti" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "Visualizza e gestisci le tue liste di contatti" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "Le mie liste di contatti" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "Aggiungi un modulo d'iscrizione" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "Personalizza un modulo di iscrizione e aggiungilo al tuo sito web Wordpress" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "I miei widget" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "Visualizzare le statistiche" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "Visualizza le tue statistiche di invio per un determinato periodo di tempo" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "Le mie statistiche" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "Aggiornare le impostazioni" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "Rivedi e modifica le impostazioni del tuo plugin" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "Enable or disable the sending of your emails through your Mailjet account" +msgstr "Attiva o disattiva l'invio delle e-mail tramite il tuo account Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "Attivare l'invio di e-mail tramite Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "Da: Nome" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "es: Jenny Ford" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "Da: nome@email.com" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "Porta da utilizzare per la comunicazione SMTP" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "" +"Abilitare la comunicazione SSL con mailjet.com (disponibile solo con la porta 465)" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "Inviare un test" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "Destinatario dell'e-mail di prova" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "Invia" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 +#: src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "Attivare l'invio di e-mail tramite Mailjet" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "" +"Can not connect to Mailjet with the selected settings. Check if a firewall is blocking " +"connections to the Mailjet ports." +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +msgid "Please provide a valid email address" +msgstr "Fornisci un indirizzo email valido" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't block the SMTP " +"ports. Also double check that you are using correct API and Secret keys and a valid " +"sending address from your Mailjet account." +msgstr "" +"Non è stato possibile inviare l'e-mail di prova. Per favore, assicurati che il server " +"non blocchi le porte SMTP. Inoltre, controlla di nuovo che tu stia usando le corrette " +"chiavi API e segrete e un indirizzo di invio valido dal tuo account Mailjet." + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "La tua email di prova è stata inviata con successo" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +msgid "" +"Your settings have been saved, but your port and SSL settings were changed to ensure " +"delivery" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You can add your " +"Wordpress subscribers to one of them, or use them to collect new email addresses." +msgstr "" +"Ecco le liste di contatti che abbiamo rilevato sul tuo account Mailjet. Puoi " +"aggiungere i tuoi utenti Wordpress a uno di esse, o usarle per raccogliere nuovi " +"indirizzi e-mail." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "La tua lista di contatti di Mailjet" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +msgid "contact" +msgstr "contatto" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "contatti" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "Crea una nuova lista" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "Nome della tua lista (massimo di 50 caratteri)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "Sincronizza i tuoi utenti Wordpress" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "" +"If you wish, you can add your Wordpress website users (readers, authors, " +"administrators, …) to a contact list." +msgstr "" +"Se vuoi, puoi aggiungere i tuoi utenti del sito Wordpress (lettori, autori, " +"amministratori, ecc.) ad un elenco di contatti." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 +#: src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "Aggiungere automaticamente gli utenti di Wordpress a un elenco specifico" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "Automatically add all my future Wordpress subscribers to a specific contact list" +msgstr "" +"Aggiungi automaticamente tutti i miei futuri utenti Wordpress ad un elenco di contatti " +"specifico" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "Also, add existing %s Wordpress users (initial synchronization)" +msgstr "" +"Inoltre, aggiungi utenti esistenti %s Wordpress (sincronizzazione iniziale)" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:180 +#: src/includes/SettingsPages/InitialContactListsSettings.php:201 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:159 +msgid "" +"The settings could not be saved. Please try again or in case the problem persists " +"contact Mailjet support." +msgstr "" +"Non è stato possibile salvare le impostazioni. Per favore, riprova o nel caso in cui " +"il problema persista contatta l'assistenza Mailjet." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:190 +msgid "Congratulations! You have just created a new contact list!" +msgstr "Congratulazioni! Hai appena creato un nuovo elenco di contatti!" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:196 +#, php-format +msgid "A contact list with name %s already exists" +msgstr "Esiste già una lista contatti con tale nome %s" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 +#: src/includes/SettingsPages/InitialSettings.php:168 +msgid "" +"Mailjet is an email service provider. With this plugin, easily send newsletters to " +"your website users, directly from Wordpress." +msgstr "" +"Mailjet è un fornitore di servizi e-mail. Con questo plugin, puoi inviare facilmente " +"newsletter agli utenti del tuo sito web, direttamente da Wordpress." + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "Applica e continua" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "Salta questo passaggio" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "Successivo" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 +#: src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "Hai bisogno di aiuto per iniziare?" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My Account > API Keys and paste " +"your credentials below" +msgstr "" +"Vai su Il mio account > Chiavi API e incolla le credenziali qui sotto" + +#: src/includes/SettingsPages/InitialSettings.php:182 +msgid "Connect your account" +msgstr "Collega il tuo account Mailjet" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "Non hai ancora un account Mailjet?" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "Crea un account" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "Raccogli gli indirizzi email..." + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "Gli indirizzi e-mail sono raccolti dal tuo sito web" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "…e aggiungi alla tua lista di contatti Mailjet" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "Email are added to your contact list" +msgstr "Gli indirizzi email vengono aggiunti al tuo elenco di contatti" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "Ci occuperemo del recapito delle tue newsletter" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "" +"Easily create and send newsletters to your subscribers from Wordpress. Mailjet will " +"deliver them!" +msgstr "" +"Crea e invia facilmente newsletter ai tuoi iscritti da Wordpress. Mailjet le " +"consegnerà!" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 +#: src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "" +"Select which Wordpress user roles (in addition to Administrator) will also have access " +"to the Mailjet Plugin" +msgstr "" +"Seleziona quali ruoli di utente di amministrazione di Wordpress (oltre " +"all'Amministratore) avranno accesso al Plugin Mailjet" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "Attiva l'integrazione di WooCommerce" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +msgid "" +"Display \"Subscribe to our newsletter\" checkbox in the checkout page and add " +"subscibers to this list" +msgstr "" +"Visualizza la casella di controllo \"Iscrivi alla nostra newsletter\" nella pagina di " +"checkout e aggiungi gli iscritti a questa lista" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +msgid "" +"The settings could not be saved. Please select a contact list to subscribe WooCommerce " +"users to." +msgstr "" +"Non è stato possibile salvare le impostazioni. Per favore, riprova o nel caso in cui " +"il problema persista contatta l'assistenza Mailjet." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "" +"Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply\" form to " +"allow comment authors to join a specific contact list" +msgstr "" +"Visualizza la casella di controllo \"Iscriviti alla nostra mailing list\" sul modulo " +"\"Lascia una risposta\", per consentire agli autori di commenti di iscriversi a una " +"specifica lista di contatti" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "Opzioni di iscrizione" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "Seleziona una lista di contatti." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "" +"Something went wrong with adding existing Wordpress users to your Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "All Wordpress users were successfully added to your Mailjet contact list" +msgstr "" +"Tutti gli utenti di Wordpress sono stati aggiunti con successo al tuo elenco di " +"contatti Mailjet" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +msgid "Subscribe to our newsletter" +msgstr "Sì, voglio iscrivermi a questa lista" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "Per favore conferma la tua iscrizione" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "" +"To receive newsletters from %s please confirm your subscription by clicking the " +"following button:" +msgstr "" +"Per ricevere le newsletter a partire da %s, conferma la tua iscrizione cliccando sul " +"seguente pulsante:" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "Sì, voglio iscrivermi a questa lista" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, simply " +"ignore this message." +msgstr "" +"Se hai ricevuto questa e-mail per errore o non vuoi più iscriverti, semplicemente " +"ignora questo messaggio." + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "Conferma d'iscrizione" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 +#: src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "Accesso utente" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "Amministratore" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "Editore" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "Autore" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "Collaboratore" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "Sottoscrittore" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "Le modifiche sono state salvate" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "Permette ai tuoi visitatori di iscriversi a uno dei tuoi elenchi" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "Widget di iscrizione a Mailjet" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "Inglese" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "Francese" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "Tedesco" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "Spagnolo" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "Italiano" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "tua@email.com" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "Iscritto" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "" +"Subscription confirmation email sent. Please check your inbox and confirm your " +"subscription." +msgstr "" +"Conferma dell'iscrizione tramite e-mail. Controlla la tua casella di posta e conferma " +"l'iscrizione." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "La tua iscrizione è stata confermata con successo." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "Si prega di inserire un indirizzo e-mail" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "Questo indirizzo e-mail è già stato registrato." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "Il valore immesso non è nel formato corretto." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "A technical issue has prevented your subscription. Please try again later." +msgstr "Un problema tecnico ha impedito l'iscrizione. Si prega di riprovare più tardi." + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, simply " +"ignore this message" +msgstr "" +"Se hai ricevuto questa e-mail per errore o non vuoi più iscriverti, semplicemente " +"ignora questo messaggio" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "Scegli le lingue supportate dal tuo modulo d'iscrizione:" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "Titolo del modulo:" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "Iscriviti per ricevere le newsletter" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "Aggiungere l'indirizzo e-mail a:" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "Scegli una lista" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "Modulo di personalizzazione avanzata" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and customize " +"the labels, error messages and confirmation email wordings." +msgstr "" +"Aggiungi altri campi al tuo modulo (es: Nome, Cognome, Data di Nascita...) e " +"personalizza le etichette, i messaggi di errore e le e-mail di conferma." + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "Personalizza il tuo modulo di iscrizione" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "Campi del modulo" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "Messaggi di convalida del modulo" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "Conferma contenuto e-mail" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "Pagina di \"Ringraziamento\"" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "Puoi aggiungere fino a 5 proprietà di contatto per raccogliere dati aggiuntivi:" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "Proprietà" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "Proprietà" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "Selezionare una proprietà di contatto" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "Crea una nuova lista" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "Dai un nome alla tua proprietà (senza spazi)" + +#: src/widget/views/admin.php:184 +msgid "Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; $ " +msgstr "Caratteri vietati: spazi , * + - / \"': [] ()> <=; $ " + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "Tipo di proprietà" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "Opzionale" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "Obbligatorio" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "Nascosto" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "Personalizzare il testo sostitutivo per il campo dell'indirizzo e-mail:" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "Indirizzo e-mail campo testo sostitutivo" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "Personalizzare l'etichetta del pulsante di invio:" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "Etichetta pulsante" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as they interact " +"with the subscription form. Leave empty fields to use the default values." +msgstr "" +"Puoi personalizzare i messaggi di errore e di successo visualizzati agli utenti che " +"interagiscono con il modulo di iscrizione. Lascia i campi vuoti per utilizzare i " +"valori predefiniti." + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "Descrizione" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "Modulo inviato con successo" + +#: src/widget/views/admin.php:306 +msgid "" +"Subscription confirmed (displayed after the user has clicked the confirmation email)" +msgstr "" +"Conferma dell'iscrizione (visualizzata dopo che l'utente ha cliccato sull'e-mail di " +"conferma)" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "Errore: il campo e-mail è vuoto" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "Errore: l'indirizzo e-mail è già stato registrato" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "Errore: Formato dati non valido (solo per numeri e date)" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "Messaggio generico di errore tecnico" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a button they " +"need to click on to confirm their subscription. You can customize the text of the " +"confirmation email if you wish. Leave empty fields to use the default values." +msgstr "" +"Quando un utente compila il modulo, riceverà un'email contenente un pulsante su cui " +"cliccare per confermare la sua iscrizione. Se vuoi, è possibile personalizzare il " +"testo dell'e-mail di conferma. Lascia i campi vuoti per utilizzare i valori " +"predefiniti." + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "Oggetto dell'e-mail" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "Contenuto dell'e-mail: titolo" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "Contenuto dell'e-mail: testo principale" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "Contenuto e-mail: etichetta pulsante di conferma" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "Contenuto dell'e-mail: testo dopo il pulsante" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful subscription " +"confirmation or leave empty to use the default \"Thank you\" page" +msgstr "" +"Seleziona una pagina dal tuo sito Wordpress da mostrare dopo la conferma " +"dell'iscrizione o lasciala vuota per utilizzare la pagina predefinita di " +"\"Ringraziamento\"" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "" + +msgid "language_checkbox" +msgstr "" + +msgid "title" +msgstr "" + +msgid "list" +msgstr "0" + +msgid "language_mandatory_email" +msgstr "" + +msgid "language_mandatory_button" +msgstr "" + +msgid "contactProperties0" +msgstr "" + +msgid "propertyDataType0" +msgstr "0" + +msgid "EnglishLabel0" +msgstr "" + +msgid "FrenchLabel0" +msgstr "" + +msgid "GermanLabel0" +msgstr "" + +msgid "SpanishLabel0" +msgstr "" + +msgid "ItalianLabel0" +msgstr "" + +msgid "contactProperties1" +msgstr "" + +msgid "propertyDataType1" +msgstr "0" + +msgid "EnglishLabel1" +msgstr "" + +msgid "FrenchLabel1" +msgstr "" + +msgid "GermanLabel1" +msgstr "" + +msgid "SpanishLabel1" +msgstr "" + +msgid "ItalianLabel1" +msgstr "" + +msgid "contactProperties2" +msgstr "" + +msgid "propertyDataType2" +msgstr "0" + +msgid "EnglishLabel2" +msgstr "" + +msgid "FrenchLabel2" +msgstr "" + +msgid "GermanLabel2" +msgstr "" + +msgid "SpanishLabel2" +msgstr "" + +msgid "ItalianLabel2" +msgstr "" + +msgid "contactProperties3" +msgstr "" + +msgid "propertyDataType3" +msgstr "0" + +msgid "EnglishLabel3" +msgstr "" + +msgid "FrenchLabel3" +msgstr "" + +msgid "GermanLabel3" +msgstr "" + +msgid "SpanishLabel3" +msgstr "" + +msgid "ItalianLabel3" +msgstr "" + +msgid "contactProperties4" +msgstr "" + +msgid "propertyDataType4" +msgstr "0" + +msgid "EnglishLabel4" +msgstr "" + +msgid "FrenchLabel4" +msgstr "" + +msgid "GermanLabel4" +msgstr "" + +msgid "SpanishLabel4" +msgstr "" + +msgid "ItalianLabel4" +msgstr "" + +msgid "confirmation_email_message_input" +msgstr "" + +msgid "subscription_confirmed_message_input" +msgstr "" + +msgid "empty_email_message_input" +msgstr "" + +msgid "already_subscribed_message_input" +msgstr "" + +msgid "invalid_data_format_message_input" +msgstr "" + +msgid "generic_technical_error_message_input" +msgstr "" + +msgid "email_subject" +msgstr "" + +msgid "email_content_title" +msgstr "" + +msgid "email_content_main_text" +msgstr "" + +msgid "email_content_confirm_button" +msgstr "" + +msgid "email_content_after_button" +msgstr "" + +#~ msgid "You have been successfully subscribed to a Mailjet contact list" +#~ msgstr "Ti sei iscritto con successo" + +#~ msgid "" +#~ "Subscription confirmation email sent. Please check your inbox and confirm the " +#~ "subscription." +#~ msgstr "" +#~ "Subscription confirmation email sent. Please check your inbox and confirm your " +#~ "subscription." + +#~ msgid "Newsletter Registration" +#~ msgstr "Iscrizione alla newsletter" + +#~ msgid "Congratulations, you have successfully subscribed!" +#~ msgstr "Congratulazioni, ti sei iscritto con successo!" + +#~ msgid "Contacts" +#~ msgstr "Contatti" + +#~ msgid "Name your list" +#~ msgstr "Nome della tua lista" + +#~ msgid "Mailjet plugin for Wordpress" +#~ msgstr "Plugin Mailjet per Wordpress" + +#~ msgid "" +#~ "Mailjet is an email service provider. With this plugin, easily send newsletters to " +#~ "your contacts, directly from Wordpress." +#~ msgstr "" +#~ "Mailjet è un fornitore di servizi e-mail. Con questo plugin, puoi inviare " +#~ "facilmente newsletter agli utenti del tuo sito web, direttamente da Wordpress." + +#~ msgid "Confirm your mailing list subscription" +#~ msgstr "Per favore conferma la tua iscrizione" + +#~ msgid "Mailjet Enable Email Sending" +#~ msgstr "Attivare l'invio di e-mail tramite Mailjet" diff --git a/languages/wp-mailjet.pot b/languages/wp-mailjet.pot new file mode 100644 index 00000000..e035c111 --- /dev/null +++ b/languages/wp-mailjet.pot @@ -0,0 +1,991 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Mailjet plugin\n" +"POT-Creation-Date: 2018-12-03 11:06+0200\n" +"PO-Revision-Date: 2015-01-29 12:40-0000\n" +"Last-Translator: Ferhan Ismailov \n" +"Language-Team: Ferhan Ismailov \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" +"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;" +"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: vendor\n" +"X-Poedit-SearchPathExcluded-1: assets\n" + +#: src/admin/partials/MailjetAdminDisplay.php:27 +#: src/includes/MailjetMenu.php:97 src/includes/SettingsPages/AllSetup.php:70 +#: src/includes/SettingsPages/ConnectAccountSettings.php:143 +#: src/includes/SettingsPages/Dashboard.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:275 +#: src/includes/SettingsPages/InitialSettings.php:219 +msgid "Connect your Mailjet account" +msgstr "" + +#: src/admin/partials/MailjetAdminDisplay.php:36 +#: src/includes/MailjetMenu.php:100 +#: src/includes/SettingsPages/EnableSendingSettings.php:234 +msgid "Sending settings" +msgstr "" + +#: src/admin/partials/MailjetAdminDisplay.php:45 +#: src/includes/MailjetMenu.php:103 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:195 +msgid "Subscription options" +msgstr "" + +#: src/admin/partials/MailjetAdminDisplay.php:54 +#: src/includes/MailjetMenu.php:106 +#: src/includes/SettingsPages/UserAccessSettings.php:150 +msgid "User access" +msgstr "" + +#: src/admin/partials/MailjetAdminDisplay.php:63 +#: src/includes/MailjetMenu.php:109 +#: src/includes/SettingsPages/IntegrationsSettings.php:116 +#: src/includes/SettingsPages/IntegrationsSettings.php:174 +msgid "Integrations" +msgstr "" + +#: src/includes/MailjetMail.php:116 +msgid "" +"Email sending failed. Please review your smtp configuration and try again " +"later" +msgstr "" + +#: src/includes/MailjetMail.php:130 +msgid "Your test mail from Mailjet" +msgstr "" + +#: src/includes/MailjetMail.php:131 +#, php-format +msgid "" +"Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s" +msgstr "" + +#: src/includes/MailjetMenu.php:50 src/includes/MailjetMenu.php:61 +#: src/includes/SettingsPages/InitialSettings.php:59 +msgid "Connect your Mailjet account to get started" +msgstr "" + +#: src/includes/MailjetMenu.php:62 src/includes/MailjetSettings.php:239 +#: src/includes/SettingsPages/ConnectAccountSettings.php:132 +#: src/includes/SettingsPages/Dashboard.php:72 +#: src/includes/SettingsPages/EnableSendingSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:163 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:184 +#: src/includes/SettingsPages/UserAccessSettings.php:139 +msgid "Settings" +msgstr "" + +#: src/includes/MailjetMenu.php:66 +msgid "Manage your Mailjet lists" +msgstr "" + +#: src/includes/MailjetMenu.php:67 +msgid "Lists" +msgstr "" + +#: src/includes/MailjetMenu.php:70 +msgid "Manage your Mailjet campaigns" +msgstr "" + +#: src/includes/MailjetMenu.php:71 +msgid "Campaigns" +msgstr "" + +#: src/includes/MailjetMenu.php:74 +msgid "View your Mailjet statistics" +msgstr "" + +#: src/includes/MailjetMenu.php:75 +msgid "Statistics" +msgstr "" + +#: src/includes/MailjetMenu.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:27 +msgid "Configure your lists." +msgstr "" + +#: src/includes/MailjetMenu.php:85 src/includes/SettingsPages/AllSetup.php:39 +msgid "You're all set up!" +msgstr "" + +#: src/includes/MailjetMenu.php:91 +#: src/includes/SettingsPages/Dashboard.php:39 +#: src/includes/SettingsPages/InitialContactListsSettings.php:240 +#: src/includes/SettingsPages/InitialSettings.php:166 +msgid "Welcome to the Mailjet plugin for Wordpress" +msgstr "" + +#: src/includes/MailjetMenu.php:192 src/includes/MailjetMenu.php:220 +#: src/includes/MailjetMenu.php:247 +#: src/includes/SettingsPages/ConnectAccountSettings.php:95 +#: src/includes/SettingsPages/InitialSettings.php:123 +#: src/widget/views/designforfailure.php:4 +msgid "" +"Please make sure that you are using the correct API key and Secret key " +"associated to your Mailjet account: https://app.mailjet.com/account/api_keys" +msgstr "" + +#: src/includes/MailjetSettings.php:179 +msgid "" +"Your Mailjet API credentials are invalid or not yet configured. Please " +"check and configure them to proceed further." +msgstr "" + +#: src/includes/MailjetSettings.php:255 +msgid "You have been successfully unsubscribed from a Mailjet contact list" +msgstr "" + +#: src/includes/MailjetSettings.php:262 +msgid "Something went wrong with adding a contact to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:40 +msgid "What would you like to do next?" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:44 +msgid "Add a subscription form to your website" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:45 +msgid "" +"Go to the widget management page and add the Mailjet Subscription Widget " +"to your website to start collecting email addresses." +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:46 +msgid "Manage my widgets" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:50 +msgid "Send an email campaign" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:51 +msgid "" +"Ready to send a newsletter to your subscribers? Simply go to your " +"Campaigns and click on \"Create a campaign\" to create and send your email." +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:52 +msgid "Create a campaign" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:56 +msgid "Configure Wordpress email sending" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:57 +msgid "" +"Enable and configure sending of all your Wordpress emails (transactional " +"emails, etc...) through Mailjet." +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:58 +msgid "Configure" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:63 +#, php-format +msgid "" +"or Go to your Mailjet Plugin Homepage" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:71 +#: src/includes/SettingsPages/ConnectAccountSettings.php:164 +#: src/includes/SettingsPages/ConnectAccountSettings.php:165 +#: src/includes/SettingsPages/Dashboard.php:81 +#: src/includes/SettingsPages/EnableSendingSettings.php:255 +#: src/includes/SettingsPages/EnableSendingSettings.php:256 +#: src/includes/SettingsPages/IntegrationsSettings.php:195 +#: src/includes/SettingsPages/IntegrationsSettings.php:196 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:216 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:217 +#: src/includes/SettingsPages/UserAccessSettings.php:171 +#: src/includes/SettingsPages/UserAccessSettings.php:172 +msgid "Need help?" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:73 +#: src/includes/SettingsPages/ConnectAccountSettings.php:167 +#: src/includes/SettingsPages/Dashboard.php:83 +#: src/includes/SettingsPages/EnableSendingSettings.php:258 +#: src/includes/SettingsPages/InitialContactListsSettings.php:278 +#: src/includes/SettingsPages/InitialSettings.php:222 +#: src/includes/SettingsPages/IntegrationsSettings.php:198 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:219 +#: src/includes/SettingsPages/UserAccessSettings.php:174 +msgid "Read our user guide" +msgstr "" + +#: src/includes/SettingsPages/AllSetup.php:74 +#: src/includes/SettingsPages/ConnectAccountSettings.php:168 +#: src/includes/SettingsPages/Dashboard.php:84 +#: src/includes/SettingsPages/EnableSendingSettings.php:259 +#: src/includes/SettingsPages/InitialContactListsSettings.php:279 +#: src/includes/SettingsPages/InitialSettings.php:223 +#: src/includes/SettingsPages/IntegrationsSettings.php:199 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:220 +#: src/includes/SettingsPages/UserAccessSettings.php:175 +msgid "Contact our support team" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:29 +msgid "" +"In your Mailjet account, go to My Account > API Keys and paste your credentials bellow" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:45 +#: src/includes/SettingsPages/InitialSettings.php:63 +msgid "Api Key" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:46 +#: src/includes/SettingsPages/InitialSettings.php:64 +msgid "Your Mailjet API Key" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:48 +#: src/includes/SettingsPages/InitialSettings.php:65 +msgid "Secret Key" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:49 +#: src/includes/SettingsPages/InitialSettings.php:66 +msgid "Your Mailjet API Secret" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:78 +#: src/includes/SettingsPages/InitialSettings.php:102 +msgid "Mailjet API credentials" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:112 +#: src/includes/SettingsPages/EnableSendingSettings.php:203 +#: src/includes/SettingsPages/InitialContactListsSettings.php:216 +#: src/includes/SettingsPages/InitialSettings.php:140 +#: src/includes/SettingsPages/IntegrationsSettings.php:143 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:164 +msgid "Settings Saved" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:128 +#: src/includes/SettingsPages/EnableSendingSettings.php:219 +#: src/includes/SettingsPages/IntegrationsSettings.php:159 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:180 +#: src/includes/SettingsPages/UserAccessSettings.php:135 +msgid "Back to dashboard" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:152 +#: src/includes/SettingsPages/EnableSendingSettings.php:243 +#: src/includes/SettingsPages/InitialContactListsSettings.php:89 +#: src/includes/SettingsPages/IntegrationsSettings.php:183 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:204 +#: src/includes/SettingsPages/UserAccessSettings.php:159 +#: src/widget/views/admin.php:202 src/widget/views/admin.php:497 +msgid "Save" +msgstr "" + +#: src/includes/SettingsPages/ConnectAccountSettings.php:155 +#: src/includes/SettingsPages/EnableSendingSettings.php:246 +#: src/includes/SettingsPages/InitialContactListsSettings.php:90 +#: src/includes/SettingsPages/IntegrationsSettings.php:186 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:207 +#: src/includes/SettingsPages/UserAccessSettings.php:162 +#: src/widget/views/admin.php:203 src/widget/views/admin.php:496 +msgid "Cancel" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:43 +msgid "Send newsletter" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:44 +msgid "Create and manage your newsletters. Vew your campaign statistics" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:45 +msgid "My campaigns" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:52 +msgid "Manage my contacts" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:53 +msgid "View and manage your contact lists" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:54 +msgid "My contact lists" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:58 +msgid "Add a subscription form" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:59 +msgid "Customize a subscription form and add it to your Wordpress website" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:60 +msgid "My widgets" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:64 +msgid "View statistics" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:65 +msgid "View your sending statistics over a period of time" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:66 +msgid "My statistics" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:70 +msgid "Update settings" +msgstr "" + +#: src/includes/SettingsPages/Dashboard.php:71 +msgid "Review and modify your plugin settings" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:28 +msgid "" +"Enable or disable the sending of your emails through your Mailjet account" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:52 +msgid "Enable sending emails through Mailjet" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:56 +msgid "From: Name" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:57 +msgid "e.g. Jenny Ford" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:60 +msgid "From: name@email.com" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:83 +msgid "Port to use for SMTP communication" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:95 +msgid "" +"Enable SSL communication with mailjet.com (only available with port 465)" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:104 +msgid "Send a test" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:106 +msgid "Recipient of the test email" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:108 +msgid "Send" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:135 +#: src/includes/SettingsPages/InitialContactListsSettings.php:152 +msgid "Enable sending emails through Mailjet" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:182 +msgid "" +"Can not connect to Mailjet with the selected settings. Check if a firewall " +"is blocking connections to the Mailjet ports." +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:187 +msgid "Please provide a valid email address" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:194 +msgid "" +"The test email could not be sent. Please make sure your server doesn't " +"block the SMTP ports. Also double check that you are using correct API and " +"Secret keys and a valid sending address from your Mailjet account." +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:197 +msgid "Your test email has been successfully sent" +msgstr "" + +#: src/includes/SettingsPages/EnableSendingSettings.php:308 +msgid "" +"Your settings have been saved, but your port and SSL settings were changed " +"to ensure delivery" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:29 +msgid "" +"Here are the contact lists we have detected on your Mailjet account. You " +"can add your Wordpress subscribers to one of them, or use them to collect " +"new email addresses." +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:56 +msgid "Your Mailjet contact lists" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:69 +msgid "contact" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:71 +msgid "contacts" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:80 +#: src/includes/SettingsPages/InitialContactListsSettings.php:81 +msgid "Create a new list" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:85 +msgid "Name your list (max. 50 characters)" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:96 +msgid "Synchronize your Wordpress users" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:97 +msgid "" +"If you wish, you can add your Wordpress website users (readers, authors, " +"administrators, …) to a contact list." +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:98 +#: src/includes/SettingsPages/IntegrationsSettings.php:55 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:31 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:55 +msgid "Automatically add Wordpress subscribers to a specific list" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:102 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:59 +msgid "" +"Automatically add all my future Wordpress subscribers to a specific " +"contact list" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:122 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:77 +#, php-format +msgid "" +"Also, add existing %s Wordpress users (initial synchronization)" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:180 +#: src/includes/SettingsPages/InitialContactListsSettings.php:201 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:159 +msgid "" +"The settings could not be saved. Please try again or in case the problem " +"persists contact Mailjet support." +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:190 +msgid "Congratulations! You have just created a new contact list!" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:196 +#, php-format +msgid "A contact list with name %s already exists" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:206 +msgid "Please enter a valid contact list name" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:242 +#: src/includes/SettingsPages/InitialSettings.php:168 +msgid "" +"Mailjet is an email service provider. With this plugin, easily send " +"newsletters to your website users, directly from Wordpress." +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:257 +msgid "Apply & Continue" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:261 +msgid "Back" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Skip this step" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:265 +msgid "Next" +msgstr "" + +#: src/includes/SettingsPages/InitialContactListsSettings.php:276 +#: src/includes/SettingsPages/InitialSettings.php:220 +msgid "Need help getting started?" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:37 +msgid "" +"If you already have a Mailjet account, go to My Account > " +"API Keys and paste your credentials below" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:182 +msgid "Connect your account" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:191 +msgid "You don't have a Mailjet account yet?" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:193 +msgid "Create an account" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Collect email addresses..." +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:202 +msgid "Email addresses are collected from your website" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "...and add them automatically to a contact list" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:206 +msgid "Email are added to your contact list" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "We will take care of delivering your newsletter" +msgstr "" + +#: src/includes/SettingsPages/InitialSettings.php:210 +msgid "" +"Easily create and send newsletters to your subscribers from Wordpress. " +"Mailjet will deliver them!" +msgstr "" + +#: src/includes/SettingsPages/IntegrationsSettings.php:28 +#: src/includes/SettingsPages/UserAccessSettings.php:28 +msgid "" +"Select which Wordpress user roles (in addition to Administrator) will also " +"have access to the Mailjet Plugin" +msgstr "" + +#: src/includes/SettingsPages/IntegrationsSettings.php:59 +msgid "Enable WooCommerce integration" +msgstr "" + +#: src/includes/SettingsPages/IntegrationsSettings.php:65 +msgid "" +"Display \"Subscribe to our newsletter\" checkbox in the checkout page and " +"add subscibers to this list" +msgstr "" + +#: src/includes/SettingsPages/IntegrationsSettings.php:138 +msgid "" +"The settings could not be saved. Please select a contact list to subscribe " +"WooCommerce users to." +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:85 +msgid "" +"Display \"Subscribe to our mailjet list\" checkbox in the \"Leave a reply" +"\" form to allow comment authors to join a specific contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:136 +msgid "Subscription Options" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:231 +msgid "Please select a contact list." +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:238 +msgid "No Wordpress users to add to Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:243 +msgid "" +"Something went wrong with adding existing Wordpress users to your Mailjet " +"contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:246 +msgid "" +"All Wordpress users were successfully added to your Mailjet contact list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:335 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:380 +msgid "Subscribe to our mailing list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:398 +msgid "Subscribe to our newsletter" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:417 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:435 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:500 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:541 +msgid "Invalid email" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:506 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:548 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:388 +msgid "Please confirm your subscription" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:507 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:549 +#, php-format +msgid "" +"To receive newsletters from %s please confirm your subscription by " +"clicking the following button:" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:510 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:552 +#: src/widget/WP_Mailjet_Subscribe_Widget.php:392 +msgid "Yes, subscribe me to this list" +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:512 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:554 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, " +"simply ignore this message." +msgstr "" + +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:518 +#: src/includes/SettingsPages/SubscriptionOptionsSettings.php:560 +msgid "Subscription Confirmation" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:46 +#: src/includes/SettingsPages/UserAccessSettings.php:101 +msgid "User Access" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:49 +msgid "Administrator" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:53 +msgid "Editor" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:57 +msgid "Author" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:61 +msgid "Contributor" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:64 +msgid "Subscriber" +msgstr "" + +#: src/includes/SettingsPages/UserAccessSettings.php:120 +msgid "User Access Settings Saved" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:48 +msgid "Allows your visitors to subscribe to one of your lists" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:51 +msgid "Mailjet Subscription Widget" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:378 +msgid "English" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:379 +msgid "French" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:380 +msgid "German" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:381 +msgid "Spanish" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:382 +msgid "Italian" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:383 +msgid "your@email.com" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:384 +msgid "Subscribe" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:385 +msgid "" +"Subscription confirmation email sent. Please check your inbox and confirm " +"your subscription." +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:386 +msgid "Your subscription was successfully confirmed." +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:387 +msgid "Please provide an email address" +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:389 +msgid "This email address has already been subscribed." +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:390 +msgid "The value you entered is not in the correct format." +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:391 +msgid "" +"A technical issue has prevented your subscription. Please try again later." +msgstr "" + +#: src/widget/WP_Mailjet_Subscribe_Widget.php:393 +msgid "" +"If you received this email by mistake or don't wish to subscribe anymore, " +"simply ignore this message" +msgstr "" + +#: src/widget/views/admin.php:24 +msgid "Choose the languages supported by your subscription form:" +msgstr "" + +#: src/widget/views/admin.php:46 +msgid "Title of the form:" +msgstr "" + +#: src/widget/views/admin.php:47 +msgid "Sign up to receive the newsletter" +msgstr "" + +#: src/widget/views/admin.php:50 +msgid "Add email addresses to:" +msgstr "" + +#: src/widget/views/admin.php:54 +msgid "Choose a list" +msgstr "" + +#: src/widget/views/admin.php:95 +msgid "Advanced form customization" +msgstr "" + +#: src/widget/views/admin.php:96 +msgid "" +"Add more fields to your form (ex: First name, Last name, Birthday...) and " +"customize the labels, error messages and confirmation email wordings." +msgstr "" + +#: src/widget/views/admin.php:107 +msgid "Customize your subscription form" +msgstr "" + +#: src/widget/views/admin.php:113 +msgid "Form fields" +msgstr "" + +#: src/widget/views/admin.php:114 +msgid "Form validation messages" +msgstr "" + +#: src/widget/views/admin.php:115 +msgid "Confirmation email content" +msgstr "" + +#: src/widget/views/admin.php:116 +msgid "Thank you page" +msgstr "" + +#: src/widget/views/admin.php:124 +msgid "You can add up to 5 contact properties to collect additional data" +msgstr "" + +#: src/widget/views/admin.php:152 +msgid "Property" +msgstr "" + +#: src/widget/views/admin.php:156 +msgid "Properties" +msgstr "" + +#: src/widget/views/admin.php:159 +msgid "Select a property" +msgstr "" + +#: src/widget/views/admin.php:160 +msgid "Create new" +msgstr "" + +#: src/widget/views/admin.php:182 +msgid "Name your property (no spaces)" +msgstr "" + +#: src/widget/views/admin.php:184 +msgid "" +"Forbidden characters: space , * + - / " ' : [ ] ( ) > < = ; " +"$ " +msgstr "" + +#: src/widget/views/admin.php:188 +msgid "Property type" +msgstr "" + +#: src/widget/views/admin.php:210 +msgid "Type" +msgstr "" + +#: src/widget/views/admin.php:215 +msgid "Optional" +msgstr "" + +#: src/widget/views/admin.php:216 +msgid "Mandatory" +msgstr "" + +#: src/widget/views/admin.php:217 +msgid "Hidden" +msgstr "" + +#: src/widget/views/admin.php:247 +msgid "Customize the placeholder text for the email address field:" +msgstr "" + +#: src/widget/views/admin.php:249 +msgid "Email address field placeholder text" +msgstr "" + +#: src/widget/views/admin.php:261 +msgid "Customize the submission button label:" +msgstr "" + +#: src/widget/views/admin.php:262 +msgid "Button label" +msgstr "" + +#: src/widget/views/admin.php:280 +msgid "" +"You can customize error and success messages displayed to your users as " +"they interact with the subscription form. Leave empty fields to use the " +"default values." +msgstr "" + +#: src/widget/views/admin.php:285 src/widget/views/admin.php:392 +msgid "Description" +msgstr "" + +#: src/widget/views/admin.php:286 +msgid "Form successfully submitted" +msgstr "" + +#: src/widget/views/admin.php:306 +msgid "" +"Subscription confirmed (displayed after the user has clicked the " +"confirmation email)" +msgstr "" + +#: src/widget/views/admin.php:322 +msgid "Error: email field is empty" +msgstr "" + +#: src/widget/views/admin.php:338 +msgid "Error: the email address is already subscribed" +msgstr "" + +#: src/widget/views/admin.php:354 +msgid "Error: Invalid data format (this applies only for numbers and dates)" +msgstr "" + +#: src/widget/views/admin.php:370 +msgid "Generic technical error message" +msgstr "" + +#: src/widget/views/admin.php:389 +msgid "" +"When a user fills in the form, they will receive an email containing a " +"button they need to click on to confirm their subscription. You can " +"customize the text of the confirmation email if you wish. Leave empty " +"fields to use the default values." +msgstr "" + +#: src/widget/views/admin.php:393 +msgid "Email subject" +msgstr "" + +#: src/widget/views/admin.php:410 +msgid "Email content: title" +msgstr "" + +#: src/widget/views/admin.php:426 +msgid "Email content: main text" +msgstr "" + +#: src/widget/views/admin.php:441 +msgid "Email content: confirmation button label" +msgstr "" + +#: src/widget/views/admin.php:456 +msgid "Email content: text after the button" +msgstr "" + +#: src/widget/views/admin.php:474 +msgid "" +"Select a page from your Wordpress site to show after successful " +"subscription confirmation or leave empty to use the default \"Thank you\" " +"page" +msgstr "" + +#: src/widget/views/admin.php:483 +msgid "Default page" +msgstr "" + +#: src/widget/views/designforfailure.php:6 +msgid "Could not connect to mailjet api, please try again later!" +msgstr "" diff --git a/libs/PHP-po-parser-master/readme.md b/libs/PHP-po-parser-master/readme.md deleted file mode 100644 index d53525fa..00000000 --- a/libs/PHP-po-parser-master/readme.md +++ /dev/null @@ -1,107 +0,0 @@ -Po Parser -========= - -[![Latest Stable Version](https://poser.pugx.org/sepia/po-parser/v/stable)](https://packagist.org/packages/sepia/po-parser) -[![Total Downloads](https://poser.pugx.org/sepia/po-parser/downloads)](https://packagist.org/packages/sepia/po-parser) -[![License](https://poser.pugx.org/sepia/po-parser/license)](https://packagist.org/packages/sepia/po-parser) -[![Build Status](https://travis-ci.org/raulferras/PHP-po-parser.png?branch=master)](https://travis-ci.org/raulferras/PHP-po-parser) -[![Code Coverage](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/coverage.png?s=a19ece2a8543b085ab1a5db319ded3bc4530b567)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/quality-score.png?s=6aaf3c31ce15cebd1d4bed718cd41fd2d921fd31)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/) -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/raulferras/PHP-po-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - - -PoParser is a personal project to fulfill a need I got: parse Gettext Portable files (*.po files) and edit its content using PHP. - -PoParser will allow you to read PO Data from any source (files and strings built-in), update it and store back to a file (or get the compiled string). - -It supports following parsing features: - -- header section. -- msgid, both single and multiline. -- msgstr, both single and multiline. -- msgctxt (Message context). -- msgid_plural (plurals forms). -- #, keys (flags). -- # keys (translator comments). -- #. keys (Comments extracted from source code). -- #: keys (references). -- #| keys (previously untranslated), both single and multiline. -- #~ keys (old entries), both single and multiline. - -Usage -===== - - // Parse a po file - $fileHandler = new Sepia\FileHandler('es.po'); - - $poParser = new Sepia\PoParser($fileHandler); - $entries = $poParser->parse(); - // $entries contains every entry in es.po file. - - // Update entries - $msgid = 'Press this button to save'; - $entries[$msgid]['msgstr'] = 'Pulsa este botón para guardar'; - $poParser->setEntry($msgid, $entries[$msgid]); - // You can also change translator comments, code comments, flags... - - - -Changelog -========= -v5.0 (WIP) -* Classes are now fluid. -* Namespaces reorganized. -* Removed `fuzzy` index in favour of `flags`. -* Display line number on parsing errors instead of line content. -* Adds compatibility with `#~|` entries. -* `parseString()` and `parseFile()` converted to factory methods. -* Removed method `updateEntry()` in favour of `setEntry()`. - -v4.2.1 -* Support multiline for plural entries (thanks @Ben-Ho) - -v4.2.0 -* Add function to add plural and context to existing entry (thanks @Ben-Ho) -* Add ability to change msg id of entry (thanks @wildex) - - -v4.1.1 -* Fixes with multi-flags entries (thanks @gnouet) - -v4.1 -* Constructor now accepts options to define separator used in multiline msgid entries. -* New method `getOptions()`. - -v4.0 - -* new methods parseString() and parseFile() replace the old parse()` -* new method writeFile() replaces the old write(). -* new method compile() which takes all parsed entries and coverts back to a PO formatted string. - -[See whole changelog](https://github.com/raulferras/PHP-po-parser/wiki/Changelog) - - -Documentation -============= -[See v4 documentation](https://github.com/raulferras/PHP-po-parser/wiki/Documentation-4.0) - - -Testing -======= -Tests are done using PHPUnit. -To execute tests, from command line type: - -``` -php vendor/bin/phpunit -``` - - -Install via composer -==================== -Edit your composer.json file to include the following: - - { - "require": { - "sepia/po-parser": "dev-master" - } - } diff --git a/libs/PHP-po-parser-master/src/Sepia/PoParser.php b/libs/PHP-po-parser-master/src/Sepia/PoParser.php deleted file mode 100644 index 295af8b5..00000000 --- a/libs/PHP-po-parser-master/src/Sepia/PoParser.php +++ /dev/null @@ -1,779 +0,0 @@ -parse(); - return $parser; - } - - - - /** - * Reads and parses a file - * - * @param string $filepath - * @param array $options - * @throws \Exception. - * @return array. List of entries found in string po formatted - */ - public static function parseFile($filepath, $options=array()) - { - $parser = new PoParser(new FileHandler($filepath), $options); - $parser->parse(); - return $parser; - } - - - public function __construct($handler, $options=array()) - { - if (($handler instanceof InterfaceHandler)===false) { - echo "ERROR ACA\n"; - throw new \InvalidArgumentException('Must provide a valid InterfaceHandler'); - } - $this->sourceHandle = $handler; - $defaultOptions = array( - 'multiline-glue'=>'<##EOL##>', // Token used to separate lines in msgid - 'context-glue' => '<##EOC##>' // Token used to separate ctxt from msgid - ); - $this->options = array_merge($defaultOptions, $options); - } - - - public function getOptions() - { - return $this->options; - } - - - public function getEntries() - { - return $this->entries; - } - - /** - * Reads and parses strings of a .po file. - * - * @param InterfaceHandler. Optional - * @throws \Exception, \InvalidArgumentException - * @return array. List of entries found in .po file. - */ - public function parse( $handle=null ) - { - if ($handle===null) { - - if ($this->sourceHandle===null || ($this->sourceHandle instanceof InterfaceHandler)===false) { - throw new \InvalidArgumentException('Must provide a valid InterfaceHandler'); - } - else { - $handle = $this->sourceHandle; - } - } - - $headers = array(); - $hash = array(); - $entry = array(); - $justNewEntry = false; // A new entry has been just inserted. - $firstLine = true; - $lastPreviousKey = null; // Used to remember last key in a multiline previous entry. - $state = null; - $lineNumber = 0; - - while (!$handle->ended()) { - $line = trim($handle->getNextLine()); - $split = preg_split('/\s+/ ', $line, 2); - $key = $split[0]; - - // If a blank line is found, or a new msgid when already got one - if ($line === '' || ($key=='msgid' && isset($entry['msgid']))) { - // Two consecutive blank lines - if ($justNewEntry) { - $lineNumber++; - continue; - } - - if ($firstLine) { - $firstLine = false; - if (self::isHeader($entry)) { - array_shift($entry['msgstr']); - $headers = $entry['msgstr']; - } else { - $hash[] = $entry; - } - } else { - // A new entry is found! - $hash[] = $entry; - } - - $entry = array(); - $state = null; - $justNewEntry = true; - $lastPreviousKey = null; - if ($line==='') { - $lineNumber++; - continue; - } - } - - $justNewEntry = false; - $data = isset($split[1]) ? $split[1] : null; - - switch ($key) { - // Flagged translation - case '#,': - $entry['flags'] = preg_split('/,\s*/', $data); - break; - - // # Translator comments - case '#': - $entry['tcomment'] = !isset($entry['tcomment']) ? array() : $entry['tcomment']; - $entry['tcomment'][] = $data; - break; - - // #. Comments extracted from source code - case '#.': - $entry['ccomment'] = !isset($entry['ccomment']) ? array() : $entry['ccomment']; - $entry['ccomment'][] = $data; - break; - - // Reference - case '#:': - $entry['reference'][] = addslashes($data); - break; - - - case '#|': // #| Previous untranslated string - case '#~': // #~ Old entry - case '#~|': // #~| Previous-Old untranslated string. Reported by @Cellard - - switch ($key) { - case '#|': $key = 'previous'; - break; - case '#~': $key = 'obsolete'; - break; - case '#~|': $key = 'previous-obsolete'; - break; - } - - $tmpParts = explode(' ', $data); - $tmpKey = $tmpParts[0]; - - if (!in_array($tmpKey, array('msgid','msgid_plural','msgstr','msgctxt'))) { - $tmpKey = $lastPreviousKey; // If there is a multiline previous string we must remember what key was first line. - $str = $data; - } else { - $str = implode(' ', array_slice($tmpParts, 1)); - } - - $entry[$key] = isset($entry[$key])? $entry[$key]:array('msgid'=>array(),'msgstr'=>array()); - - if (strpos($key, 'obsolete')!==false) { - $entry['obsolete'] = true; - switch ($tmpKey) { - case 'msgid': - $entry['msgid'][] = $str; - $lastPreviousKey = $tmpKey; - break; - - case 'msgstr': - if ($str == "\"\"") { - $entry['msgstr'][] = trim($str, '"'); - } else { - $entry['msgstr'][] = $str; - } - $lastPreviousKey = $tmpKey; - break; - - default: - break; - } - } - - if ($key!=='obsolete') { - switch ($tmpKey) { - case 'msgid': - case 'msgid_plural': - case 'msgstr': - $entry[$key][$tmpKey][] = $str; - $lastPreviousKey = $tmpKey; - break; - - default: - $entry[$key][$tmpKey] = $str; - break; - } - } - break; - - - // context - // Allows disambiguations of different messages that have same msgid. - // Example: - // - // #: tools/observinglist.cpp:700 - // msgctxt "First letter in 'Scope'" - // msgid "S" - // msgstr "" - // - // #: skycomponents/horizoncomponent.cpp:429 - // msgctxt "South" - // msgid "S" - // msgstr "" - case 'msgctxt': - // untranslated-string - case 'msgid': - // untranslated-string-plural - case 'msgid_plural': - $state = $key; - $entry[$state][] = $data; - break; - // translated-string - case 'msgstr': - $state = 'msgstr'; - $entry[$state][] = $data; - break; - - default: - if (strpos($key, 'msgstr[') !== false) { - // translated-string-case-n - $state = $key; - $entry[$state][] = $data; - } else { - // "multiline" lines - switch ($state) { - case 'msgctxt': - case 'msgid': - case 'msgid_plural': - case (strpos($state, 'msgstr[') !== false): - if (is_string($entry[$state])) { - // Convert it to array - $entry[$state] = array($entry[$state]); - } - $entry[$state][] = $line; - break; - - case 'msgstr': - // Special fix where msgid is "" - if ($entry['msgid'] == "\"\"") { - $entry['msgstr'][] = trim($line, '"'); - } else { - $entry['msgstr'][] = $line; - } - break; - - default: - throw new \Exception( - 'PoParser: Parse error! Unknown key "' . $key . '" on line ' . ($lineNumber+1) - ); - } - } - break; - } - - $lineNumber++; - } - $handle->close(); - - // add final entry - if ($state == 'msgstr') { - $hash[] = $entry; - } - - // - Cleanup header data - $this->headers = array(); - foreach ($headers as $header) { - $header = $this->clean( $header ); - $this->headers[] = "\"" . preg_replace("/\\n/", '\n', $header) . "\""; - } - - // - Cleanup data, - // - merge multiline entries - // - Reindex hash for ksort - $temp = $hash; - $this->entries = array(); - foreach ($temp as $entry) { - foreach ($entry as &$v) { - $or = $v; - $v = $this->clean($v); - if ($v === false) { - // parse error - throw new \Exception( - 'PoParser: Parse error! poparser::clean returned false on "' . htmlspecialchars($or) . '"' - ); - } - } - - // check if msgid and a key starting with msgstr exists - if (isset($entry['msgid']) && count(preg_grep('/^msgstr/', array_keys($entry)))) { - $id = $this->getEntryId($entry); - $this->entries[$id] = $entry; - } - } - - return $this->entries; - } - - /** - * Get headers from .po file - * - * @return array - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Set new headers - * - * {code} - * array( - * '"Project-Id-Version: \n"', - * '"Report-Msgid-Bugs-To: \n"', - * '"POT-Creation-Date: \n"', - * '"PO-Revision-Date: \n"', - * '"Last-Translator: none\n"', - * '"Language-Team: \n"', - * '"MIME-Version: 1.0\n"', - * '"Content-Type: text/plain; charset=UTF-8\n"', - * ); - * {code} - * - * @param array $newHeaders - * @return bool - */ - public function setHeaders($newHeaders) - { - if (!is_array($newHeaders)) { - return false; - } else { - $this->headers = $newHeaders; - return true; - } - } - - - /** - * Updates an entry. - * If entry not found returns false. If $createNew is true, a new entry will be created. - * $entry is an array that can contain following indexes: - * - msgid: String Array. Required. - * - msgstr: String Array. Required. - * - reference: String Array. - * - msgctxt: String. Disambiguating context. - * - tcomment: String Array. Translator comments. - * - ccomment: String Array. Source comments. - * - msgid_plural: String Array. - * - flags: Array. List of entry flags. Example: array('fuzzy','php-format') - * - previous: Array: Contains previous untranslated strings in a sub array with msgid and msgstr. - * - * @param String $msgid Id of entry. Be aware that some entries have a multiline msgid. In that case \n must be replaced by the value of 'multiline-glue' option (by default "<##EOL##>"). - * @param Array $entry Array with all entry data. Fields not setted will be removed. - * @param boolean $createNew If msgid not found, it will create a new entry. By default true. You want to set this to false if need to change the msgid of an entry. - */ - public function setEntry($msgid, $entry, $createNew = true) - { - // In case of new entry - if (!isset($this->entries[$msgid])) { - - if ($createNew==false) { - return; - } - - $this->entries[$msgid] = $entry; - } - else { - // Be able to change msgid. - if( $msgid!==$entry['msgid'] ) { - unset($this->entries[$msgid]); - $new_msgid = is_array($entry['msgid'])? implode($this->options['multiline-glue'], $entry['msgid']):$entry['msgid']; - $this->entries[$new_msgid] = $entry; - } - else { - $this->entries[$msgid] = $entry; - } - } - } - - - public function setEntryPlural($msgid, $plural = false) - { - if ($plural) { - $this->entries[$msgid]['msgid_plural'] = $plural; - } else { - unset($this->entries[$msgid]['msgid_plural']); - } - } - - public function setEntryContext($msgid, $context = false) - { - if ($context) { - $this->entries[$msgid]['msgctxt'][0] = $context; - } else { - unset($this->entries[$msgid]['msgctxt']); - } - } - - - /** - * Gets entries. - */ - public function entries() - { - return $this->entries; - } - - - - - - /** - * Writes entries to a po file - * - * @example - * $pofile = new PoParser(); - * $pofile->parse('ca.po'); - * - * // Modify an antry - * $pofile->updateEntry( $msgid, $msgstr ); - * // Save Changes back into `ca.po` - * $pofile->write('ca.po'); - * @param string $filepath - * @throws \Exception - * @return boolean - */ - public function writeFile($filepath) - { - $output = $this->compile(); - $result = file_put_contents($filepath, $output); - if ($result===false) { - throw new \Exception('Could not write into file '.htmlspecialchars($filepath)); - } - return true; - } - - - - - /** - * Compiles entries into a string - * - * @throws \Exception - * @return string - */ - public function compile() - { - $output = ''; - - if (count($this->headers) > 0) { - $output.= "msgid \"\"\n"; - $output.= "msgstr \"\"\n"; - foreach ($this->headers as $header) { - $output.= $header . "\n"; - } - $output.= "\n"; - } - - - $entriesCount = count($this->entries); - $counter = 0; - foreach ($this->entries as $entry) { - $isObsolete = isset($entry['obsolete']) && $entry['obsolete']; - $isPlural = isset($entry['msgid_plural']); - - if (isset($entry['previous'])) { - foreach ($entry['previous'] as $key => $data) { - - if (is_string($data)) { - $output.= "#| " . $key . " " . $this->cleanExport($data) . "\n"; - } elseif (is_array($data) && count($data)>0) { - foreach ($data as $line) { - $output.= "#| " . $key . " " . $this->cleanExport($line) . "\n"; - } - } - - } - } - - if (isset($entry['tcomment'])) { - foreach ($entry['tcomment'] as $comment) { - $output.= "# " . $comment . "\n"; - } - } - - if (isset($entry['ccomment'])) { - foreach ($entry['ccomment'] as $comment) { - $output.= '#. ' . $comment . "\n"; - } - } - - if (isset($entry['reference'])) { - foreach ($entry['reference'] as $ref) { - $output.= '#: ' . $ref . "\n"; - } - } - - if (isset($entry['flags']) && !empty($entry['flags'])) { - $output.= "#, " . implode(', ', $entry['flags']) . "\n"; - } - - if (isset($entry['@'])) { - $output.= "#@ " . $entry['@'] . "\n"; - } - - if (isset($entry['msgctxt'])) { - $output.= 'msgctxt ' . $this->cleanExport($entry['msgctxt'][0]) . "\n"; - } - - - if ($isObsolete) { - $output.= "#~ "; - } - - if (isset($entry['msgid'])) { - // Special clean for msgid - if (is_string($entry['msgid'])) { - $msgid = explode("\n", $entry['msgid']); - } elseif (is_array($entry['msgid'])) { - $msgid = $entry['msgid']; - } else { - throw new \Exception('msgid not string or array'); - } - - $output.= 'msgid '; - foreach ($msgid as $i => $id) { - if ($i > 0 && $isObsolete) { - $output.= "#~ "; - } - $output.= $this->cleanExport($id) . "\n"; - } - } - - if (isset($entry['msgid_plural'])) { - // Special clean for msgid_plural - if (is_string($entry['msgid_plural'])) { - $msgidPlural = explode("\n", $entry['msgid_plural']); - } elseif (is_array($entry['msgid_plural'])) { - $msgidPlural = $entry['msgid_plural']; - } else { - throw new \Exception('msgid_plural not string or array'); - } - - $output.= 'msgid_plural '; - foreach ($msgidPlural as $plural) { - $output.= $this->cleanExport($plural) . "\n"; - } - } - - if (count(preg_grep('/^msgstr/', array_keys($entry)))) { // checks if there is a key starting with msgstr - if ($isPlural) { - foreach ($entry as $key => $value) { - if (strpos($key, 'msgstr[') === false) continue; - $output.= $key." "; - foreach ($value as $i => $t) { - $output.= $this->cleanExport($t) . "\n"; - } - } - } else { - foreach ((array)$entry['msgstr'] as $i => $t) { - if ($i == 0) { - if ($isObsolete) { - $output.= "#~ "; - } - - $output.= 'msgstr ' . $this->cleanExport($t) . "\n"; - } else { - if ($isObsolete) { - $output.= "#~ "; - } - - $output.= $this->cleanExport($t) . "\n"; - } - } - } - } - - $counter++; - // Avoid inserting an extra newline at end of file - if ($counter < $entriesCount) { - $output.= "\n"; - } - } - - return $output; - } - - - /** - * Prepares a string to be outputed into a file. - * - * @param string $string The string to be converted. - * @return string - */ - protected function cleanExport($string) - { - $quote = '"'; - $slash = '\\'; - $newline = "\n"; - - $replaces = array( - "$slash" => "$slash$slash", - "$quote" => "$slash$quote", - "\t" => '\t', - ); - - $string = str_replace(array_keys($replaces), array_values($replaces), $string); - - $po = $quote . implode("${slash}n$quote$newline$quote", explode($newline, $string)) . $quote; - - // remove empty strings - return str_replace("$newline$quote$quote", '', $po); - } - - - /** - * Generates the internal key for a msgid. - * - * @param array $entry - * @return string - */ - protected function getEntryId(array $entry) - { - if (isset($entry['msgctxt'])) { - $id = implode($this->options['multiline-glue'], (array)$entry['msgctxt']) . $this->options['context-glue'] . implode($this->options['multiline-glue'], (array)$entry['msgid']); - } else { - $id = implode($this->options['multiline-glue'], (array)$entry['msgid']); - } - - return $id; - } - - - /** - * Undos `cleanExport` actions on a string. - * - * @param string|array $x - * @return string|array. - */ - protected function clean($x) - { - if (is_array($x)) { - foreach ($x as $k => $v) { - $x[$k] = $this->clean($v); - } - } else { - // Remove double quotes from start and end of string - if ($x == '') { - return ''; - } - - if ($x[0] == '"') { - $x = substr($x, 1, -1); - } - - // Escapes C-style escape sequences (\a,\b,\f,\n,\r,\t,\v) and converts them to their actual meaning - $x = stripcslashes($x); - - } - - return $x; - } - - - /** - * Checks if entry is a header by - * - * @param array $entry - * @return bool - */ - protected static function isHeader(array $entry) - { - if (empty($entry) || !isset($entry['msgstr'])) { - return false; - } - - $headerKeys = array( - 'Project-Id-Version:' => false, - // 'Report-Msgid-Bugs-To:' => false, - // 'POT-Creation-Date:' => false, - 'PO-Revision-Date:' => false, - // 'Last-Translator:' => false, - // 'Language-Team:' => false, - 'MIME-Version:' => false, - // 'Content-Type:' => false, - // 'Content-Transfer-Encoding:' => false, - // 'Plural-Forms:' => false - ); - $count = count($headerKeys); - $keys = array_keys($headerKeys); - - $headerItems = 0; - foreach ($entry['msgstr'] as $str) { - $tokens = explode(':', $str); - $tokens[0] = trim($tokens[0], "\"") . ':'; - - if (in_array($tokens[0], $keys)) { - $headerItems++; - unset($headerKeys[$tokens[0]]); - $keys = array_keys($headerKeys); - } - } - return ($headerItems == $count) ? true : false; - } -} diff --git a/libs/php.mo-master/php-mo.php b/libs/php.mo-master/php-mo.php deleted file mode 100644 index 82f4bf21..00000000 --- a/libs/php.mo-master/php-mo.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * NB: - * - If no $output_file specified, output filename is same as $input_file (but .mo) - * - Returns true/false for success/failure - * - No warranty, but if it breaks, please let me know - * - * More info: - * https://github.com/josscrowcroft/php.mo - * - * Based on php-msgfmt by Matthias Bauer (Copyright 2007), a command-line PHP tool - * for converting .po files to .mo. - * (http://wordpress-soc-2007.googlecode.com/svn/trunk/moeffju/php-msgfmt/msgfmt.php) - * - * License: GPL v3 http://www.opensource.org/licenses/gpl-3.0.html - */ - -/** - * The main .po to .mo function - */ -function phpmo_convert($input, $output = false) { - if ( !$output ) - $output = str_replace( '.po', '.mo', $input ); - - $hash = phpmo_parse_po_file( $input ); - if ( $hash === false ) { - return false; - } else { - return phpmo_write_mo_file( $hash, $output ); - } -} - -function phpmo_clean_helper($x) { - if (is_array($x)) { - foreach ($x as $k => $v) { - $x[$k] = phpmo_clean_helper($v); - } - } else { - if ($x[0] == '"') - $x = substr($x, 1, -1); - $x = str_replace("\"\n\"", '', $x); - $x = str_replace('$', '\\$', $x); - } - return $x; -} - -/* Parse gettext .po files. */ -/* @link http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files */ -function phpmo_parse_po_file($in) { - // read .po file - $fh = fopen($in, 'r'); - if ($fh === false) { - // Could not open file resource - return false; - } - - // results array - $hash = array (); - // temporary array - $temp = array (); - // state - $state = null; - $fuzzy = false; - - // iterate over lines - while(($line = fgets($fh, 65536)) !== false) { - $line = trim($line); - if ($line === '') - continue; - - if (count(preg_split('/\s/', $line, 2)) < 2){ - continue; - } - list ($key, $data) = preg_split('/\s/', $line, 2); - - switch ($key) { - case '#,' : // flag... - $fuzzy = in_array('fuzzy', preg_split('/,\s*/', $data)); - case '#' : // translator-comments - case '#.' : // extracted-comments - case '#:' : // reference... - case '#|' : // msgid previous-untranslated-string - // start a new entry - if (sizeof($temp) && array_key_exists('msgid', $temp) && array_key_exists('msgstr', $temp)) { - if (!$fuzzy) - $hash[] = $temp; - $temp = array (); - $state = null; - $fuzzy = false; - } - break; - case 'msgctxt' : - // context - case 'msgid' : - // untranslated-string - case 'msgid_plural' : - // untranslated-string-plural - $state = $key; - $temp[$state] = $data; - break; - case 'msgstr' : - // translated-string - $state = 'msgstr'; - $temp[$state][] = $data; - break; - default : - if (strpos($key, 'msgstr[') !== FALSE) { - // translated-string-case-n - $state = 'msgstr'; - $temp[$state][] = $data; - } else { - // continued lines - switch ($state) { - case 'msgctxt' : - case 'msgid' : - case 'msgid_plural' : - $temp[$state] .= "\n" . $line; - break; - case 'msgstr' : - $temp[$state][sizeof($temp[$state]) - 1] .= "\n" . $line; - break; - default : - // parse error - fclose($fh); - return FALSE; - } - } - break; - } - } - fclose($fh); - - // add final entry - if ($state == 'msgstr') - $hash[] = $temp; - - // Cleanup data, merge multiline entries, reindex hash for ksort - $temp = $hash; - $hash = array (); - foreach ($temp as $entry) { - foreach ($entry as & $v) { - $v = phpmo_clean_helper($v); - if ($v === FALSE) { - // parse error - return FALSE; - } - } - $hash[$entry['msgid']] = $entry; - } - - return $hash; -} - -/* Write a GNU gettext style machine object. */ -/* @link http://www.gnu.org/software/gettext/manual/gettext.html#MO-Files */ -function phpmo_write_mo_file($hash, $out) { - // sort by msgid - ksort($hash, SORT_STRING); - // our mo file data - $mo = ''; - // header data - $offsets = array (); - $ids = ''; - $strings = ''; - - foreach ($hash as $entry) { - $id = $entry['msgid']; - if (isset ($entry['msgid_plural'])) - $id .= "\x00" . $entry['msgid_plural']; - // context is merged into id, separated by EOT (\x04) - if (array_key_exists('msgctxt', $entry)) - $id = $entry['msgctxt'] . "\x04" . $id; - // plural msgstrs are NUL-separated - $str = implode("\x00", $entry['msgstr']); - // keep track of offsets - $offsets[] = array ( - strlen($ids - ), strlen($id), strlen($strings), strlen($str)); - // plural msgids are not stored (?) - $ids .= $id . "\x00"; - $strings .= $str . "\x00"; - } - - // keys start after the header (7 words) + index tables ($#hash * 4 words) - $key_start = 7 * 4 + sizeof($hash) * 4 * 4; - // values start right after the keys - $value_start = $key_start +strlen($ids); - // first all key offsets, then all value offsets - $key_offsets = array (); - $value_offsets = array (); - // calculate - foreach ($offsets as $v) { - list ($o1, $l1, $o2, $l2) = $v; - $key_offsets[] = $l1; - $key_offsets[] = $o1 + $key_start; - $value_offsets[] = $l2; - $value_offsets[] = $o2 + $value_start; - } - $offsets = array_merge($key_offsets, $value_offsets); - - // write header - $mo .= pack('Iiiiiii', 0x950412de, // magic number - 0, // version - sizeof($hash), // number of entries in the catalog - 7 * 4, // key index offset - 7 * 4 + sizeof($hash) * 8, // value index offset, - 0, // hashtable size (unused, thus 0) - $key_start // hashtable offset - ); - // offsets - foreach ($offsets as $offset) - $mo .= pack('i', $offset); - // ids - $mo .= $ids; - // strings - $mo .= $strings; - - return file_put_contents($out, $mo); -} -?> \ No newline at end of file diff --git a/logs.txt b/logs.txt new file mode 100644 index 00000000..e69de29b diff --git a/mailjet-api-strategy.php b/mailjet-api-strategy.php deleted file mode 100644 index 62f2edd8..00000000 --- a/mailjet-api-strategy.php +++ /dev/null @@ -1,940 +0,0 @@ -userSenderList(); - if($userSenderList) { - $response = $userSenderList->senders; - } - - // Check if the list exists - if (isset($response)) { - $senders = array(); - $senders['domain'] = array(); - $senders['email'] = array(); - - foreach ($response as $sender) { - if ($sender->status == 'active') { - if (substr($sender->email, 0, 2) == '*@') - $senders['domain'][] = substr($sender->email, 2, strlen($sender->email)); // This is domain - else - $senders['email'][] = $sender->email; // This is email - } - } - return $senders; - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Get full list of contact lists - * - * @param (array) $param = array('limit', ...) - * @return (object) - */ - public function getContactLists($params) - { - // Set input parameters - $input = array(); - if (isset($params['limit'])) $input['limit'] = $params['limit']; - - // Get the list - $response = $this->listsAll($input); - - // Check if the list exists - if (isset($response->status) && $response->status == 'OK') { - $lists = array(); - foreach ($response->lists as $list) { - $lists[] = array( - 'value' => $list->id, - 'label' => $list->label, - ); - } - return $lists; - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Get list of user contact meta properties. v1 users do not have such feature - * - * @param array - * @return null - */ - public function getContactMetaProperties($params) - { - return array(); - } - - public function createMetaContactProperty($params) - { - return array(); - } - - public function findRecipient($params){ - $params['method'] = 'GET'; - $params['id'] = $params['ContactsList']; - unset($params['ContactsList']); - $email = $params['ContactEmail']; - unset($params['ContactEmail']); - $response = $this->listsContacts($params); - if (empty($response->result)) { - return false; - } - $contactExists = false; - foreach($response->result as $contact) { - if ($contact->email === $email) { - $contactExists = true; - break; - } - } - return $contactExists; - } - - /** - * Add a contact to a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function addContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) - return (object)array('Status' => 'ERROR'); - - // Add the contact - $response = $this->listsAddContact(array( - 'method' => 'POST', - 'contact' => $params['Email'], - 'id' => $params['ListID'] - )); - - // Check if the contact is added - if ($response) - return (object)array('Status' => 'OK'); - - return (object)array('Status' => 'ERROR'); - } - - public function updateContactData($params) - { - } - - /** - * Remove a contact from a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function removeContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) - return (object)array('Status' => 'ERROR'); - - // Unsubscribe the contact - $response = $this->listsRemoveContact(array( - 'method' => 'POST', - 'contact' => $params['Email'], - 'id' => $params['ListID'] - )); - - // Check if the contact is added - if ($response) - return (object)array('Status' => 'OK'); - - return (object)array('Status' => 'OK'); - } - - /** - * Unsubscribe a contact from a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function unsubContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) - return (object)array('Status' => 'ERROR'); - - // Unsubscribe the contact - $response = $this->listsUnsubContact(array( - 'method' => 'POST', - 'contact' => $params['Email'], - 'id' => $params['ListID'] - )); - - // Check if the contact is added - if ($response) - return (object)array('Status' => 'OK'); - - return (object)array('Status' => 'OK'); - } - - /** - * Subscribe a contact to a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function subContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) - return (object)array('Status' => 'ERROR'); - - // Subscribe the user - $response = $this->listsAddContact(array( - 'method' => 'POST', - 'id' => $params['ListID'], - 'contact' => $params['Email'], - 'force' => 1, - )); - - // Check if the contact is added - if ($response) { - return (object)array( - 'Status' => 'OK', - 'Response' => $response - ); - } - - - return (object)array( - 'Status' => 'ERROR' - ); - } - - public function manageManyContacts($params) - { - - } - - - - - /** - * Get the authentication token for the iframes - * - * @param (array) $param = array('APIKey', 'SecretKey', 'MailjetToken', ...) - * @return (object) - */ - public function getAuthToken($params) - { - // Check if the input data is OK - if (strlen(trim($params['APIKey'])) == 0 || strlen(trim($params['SecretKey'])) == 0 || strlen(trim($params['MailjetToken'])) == 0) - return (object)array('Status' => 'ERROR'); - - if ($op = $params['MailjetToken']) { - $op = json_decode($op); - if ($op->timestamp > time() - 3600) - return $op->token; - } - - if (!defined('WPLANG')) - $locale = 'en'; - else { - $locale = substr(WPLANG, 0, 2); - if (!in_array($locale, array('en', 'fr', 'es', 'de'))) - $locale = 'en'; - } - - $res = wp_remote_post( - $this->apiUrl . '/apiKeyauthenticate?output=json', - array( - 'headers' => array('Authorization' => 'Basic ' . base64_encode($params['APIKey'] . ':' . $params['SecretKey'])), - 'body' => array( - 'allowed_access[0]' => 'stats', - 'allowed_access[1]' => 'contacts', - 'allowed_access[2]' => 'campaigns', - 'lang' => $locale, - 'default_page' => 'campaigns', - 'type' => 'page', - 'apikey' => $params['APIKey'] - ) - ) - ); - - if (is_array($res)) { - $resp = json_decode($res['body']); - if ($resp->status == 'OK') { - update_option('mailjet_token' . $_SERVER['REMOTE_ADDR'], json_encode(array('token' => $resp->token, 'timestamp' => time()))); - return $resp->token; - } - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Validate if $email is real email - * - * @param (string) $email - * @return (boolean) TRUE|FALSE - */ - public function validateEmail($email) - { - return (preg_match("/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/", $email) || !preg_match("/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/", $email)) ? FALSE : TRUE; - } -} - - -# Strategy ApiV3 -class WP_Mailjet_Api_Strategy_V3 extends WP_Mailjet_Api_V3 implements WP_Mailjet_Api_Interface -{ - - public function getMetaDataContact() - { - return $this->{'metadata/contact'}(); - } - - /** - * Get full list of senders - * - * @param (array) $param = array('limit', ...) - * @return (object) - */ - public function getSenders($params) - { - // Set input parameters - $input = array(); - if (isset($params['limit'])) { - $input['limit'] = $params['limit']; - } - - // Get the list - $response = $this->sender($input); - - // Check if the list exists - if (isset($response->Data)) { - $senders = array(); - $senders['domain'] = array(); - $senders['email'] = array(); - - foreach ($response->Data as $sender) { - if ($sender->Status == 'Active') { - if (substr($sender->Email, 0, 2) == '*@') - $senders['domain'][] = substr($sender->Email, 2, strlen($sender->Email)); // This is domain - else - $senders['email'][] = $sender->Email; // This is email - } - } - return $senders; - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Get full list of contact lists - * - * @param (array) $param = array('limit', ...) - * @return (object) - */ - public function getContactLists($params) - { - // Set input parameters - $input = array(//'akid' => $this->_akid - ); - if (isset($params['limit'])) $input['limit'] = $params['limit']; - - // Get the list - $response = $this->liststatistics($input); - - // Check if the list exists - if (isset($response->Data)) { - $lists = array(); - foreach ($response->Data as $list) { - $lists[] = array( - 'value' => $list->ID, - 'label' => $list->Name, - ); - } - return $lists; - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Get list of user contact meta properties. v3 users only - * - * @param array - * @return object - */ - public function getContactMetaProperties($params) - { - return $this->contactmetadata($params); - } - - /** - * Create a new meta contact property - * - * @param array - * @return object - */ - public function createMetaContactProperty($params) - { - $response = $this->contactmetadata(array( - 'method' => 'POST', - 'Datatype' => $params['dataType'], - 'Name' => $params['name'], - 'NameSpace' => 'static', - )); - if ((empty($response->ErrorMessage) && !empty($response))) { - $status = 'OK'; - $msg = 'Property created. Please drag your new contact property to the Selected Properties section above.'; - } elseif ((!empty($response->ErrorMessage) && strpos($response->ErrorMessage, 'already exists'))) { - $status = 'Error'; - $msg = 'Property already exists'; - } else { - $status = 'Error'; - $msg = 'Property could not be created - ' . $response->ErrorMessage; - } - return array( - 'status' => $status, - 'message' => $msg - ); - } - - public function updateContactData($params) - { - $response = $this->contactdata($params); - if (empty($response->Data) || empty($response->Count)) { - return $response; - } - return $response; - } - - /** - * Add a contact to a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function addContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID'])) { - return (object)array('Status' => 'ERROR'); - } - - return $this->manageManyContacts(array( - 'listId' => $params['ListID'], - 'action' => $params['action'], - 'contacts' => $params['contacts'] - )); - } - - public function findRecipient($params) - { - $params['method'] = 'GET'; - return $this->listrecipient($params); - } - - /** - * Remove a contact from a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function removeContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) { - return (object)array('Status' => 'ERROR'); - } - - // Get the contact - $result = $this->listrecipient(array( - //'akid' => $this->_akid, - 'method' => 'GET', - 'ContactsList' => $params['ListID'], - 'ContactEmail' => $params['Email'] - )); - if ($result->Count > 0) { - foreach ($result->Data as $contact) { - // Remove the contact - $response = $this->listrecipient(array( - //'akid' => $this->_akid, - 'method' => 'delete', - 'ID' => $contact->ID - )); - } - - // Check if the unsubscribe is done correctly - if (isset($response->Data[0]->ID)) { - return (object)array('Status' => 'OK'); - } - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Unsubscribe a contact from a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function unsubContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) - return (object)array('Status' => 'ERROR'); - - // Get the contact - $result = $this->listrecipient(array( - 'method' => 'GET', - 'ListID' => $params['ListID'], - 'ContactEmail' => $params['Email'] - )); - if ($result->Count > 0) { - foreach ($result->Data as $contact) { - if ($contact->IsUnsubscribed !== TRUE) { - $response = $this->listrecipient(array( - //'akid' => $this->_akid, - 'method' => 'PUT', - 'ID' => $contact->ID, - 'IsUnsubscribed' => 'true', - 'UnsubscribedAt' => date("Y-m-d\TH:i:s\Z", time()), - )); - } - } - - // Check if the unsubscribe is done correctly - if (isset($response->Data[0]->ID)) - return (object)array('Status' => 'OK'); - } - - return (object)array('Status' => 'ERROR'); - } - - /** - * Subscribe a contact to a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function subContact($params) - { - // Check if the input data is OK - if (!is_numeric($params['ListID']) || !$this->validateEmail($params['Email'])) - return (object)array('Status' => 'ERROR'); - - // Get the contact - $result = $this->listrecipient(array( - 'method' => 'GET', - 'ListID' => $params['ListID'], - 'ContactEmail' => $params['Email'] - )); - - if ($result->Count > 0) { - foreach ($result->Data as $contact) { - if ($contact->IsUnsubscribed === TRUE) { - $response = $this->listrecipient(array( - //'akid' => $this->_akid, - 'method' => 'PUT', - 'ID' => $contact->ID, - 'IsUnsubscribed' => 'false', - )); - } - } - - // Check if the subscribe is done correctly - if (isset($response->Data[0]->ID)) - return (object)array('Status' => 'OK'); - } - - return (object)array('Status' => 'ERROR'); - } - - - public function manageManyContacts($params) - { - $response = $this->{'contactslist/' . $params['listId'] . '/managemanycontacts'} ( - array( - 'method' => 'JSON', - 'Action' => $params['action'], - 'Contacts' => $params['contacts'] - ) - ); - - return $response; - } - - - /** - * Get the authentication token for the iframes - * - * @param (array) $param = array('APIKey', 'SecretKey', 'MailjetToken', ...) - * @return (object) - */ - public function getAuthToken($params) - { - // Check if the input data is OK - if (strlen(trim($params['APIKey'])) == 0 || strlen(trim($params['SecretKey'])) == 0 || strlen(trim($params['MailjetToken'])) == 0) - return (object)array('Status' => 'ERROR'); - - // Get the ID of the Api Key - $api_key_response = $this->apikey(array( - 'method' => 'GET', - 'APIKey' => $params['APIKey'] - )); - - // Check if the response contains data - if (!isset($api_key_response->Data[0]->ID)) - return (object)array('Status' => 'ERROR'); - - // Get token - $response = $this->apitoken(array( - 'AllowedAccess' => 'campaigns,contacts,reports,stats,preferences,pricing,account', - 'method' => 'POST', - 'APIKeyID' => $api_key_response->Data[0]->ID, - 'TokenType' => 'url', - 'CatchedIp' => $_SERVER['REMOTE_ADDR'], - 'log_once' => TRUE, - 'IsActive' => TRUE, - 'SentData' => serialize(array('plugin' => 'wordpress-3.0')), - )); - - // Get and return the token - if (isset($response->Data) && count($response->Data) > 0) - return $response->Data[0]->Token; - - return (object)array('Status' => 'ERROR'); - } - - /** - * Validate if $email is real email - * - * @param (string) $email - * @return (boolean) TRUE|FALSE - */ - public function validateEmail($email) - { - return (preg_match("/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/", $email) || !preg_match("/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/", $email)) ? FALSE : TRUE; - } -} - - -# ============================================== Context ============================================== # -class WP_Mailjet_Api -{ - private $context; - public $version; - public $mj_host; - public $mj_mailer; - - public function __construct($mailjet_username, $mailjet_password) - { - // Is user API version recorded in DB? - $userApiVersion = get_option('mailjet_user_api_version'); - if ($userApiVersion === false) { - $userApiVersion = $this->findUserApiVersion($mailjet_username, $mailjet_password); - update_option('mailjet_user_api_version', $userApiVersion); - } - $userApiVersion = (int)$userApiVersion; - - switch ($userApiVersion) { - case 1: - $this->setContext(new WP_Mailjet_Api_Strategy_V1($mailjet_username, $mailjet_password)); - $this->mj_host = 'in.mailjet.com'; - break; - case 3: - $this->setContext(new WP_Mailjet_Api_Strategy_V3($mailjet_username, $mailjet_password)); - $this->mj_host = 'in-v3.mailjet.com'; - break; - default: - $this->clearContext(); - } - - if (false !== $this->context) { - $this->mj_mailer = 'X-Mailer:WP-Mailjet/0.1'; - $this->version = $this->context->getVersion(); - } - } - - /** - * @param $mailjet_username - * @param $mailjet_password - * @return bool|int - */ - public function findUserApiVersion($mailjet_username, $mailjet_password) - { - if ($this->isV3User($mailjet_username, $mailjet_password)) { - return 3; - } elseif ($this->isV1User($mailjet_username, $mailjet_password)) { - return 1; - } - return false; - } - - public function isV1User($mailjet_username, $mailjet_password) - { - $this->setContext(new WP_Mailjet_Api_Strategy_V1($mailjet_username, $mailjet_password)); - $response = $this->context->getSenders(array('limit' => 1)); - if (isset($response->Status) && $response->Status == 'ERROR') { - return false; - } - return true; - } - - public function isV3User($mailjet_username, $mailjet_password) - { - $v3api = new WP_Mailjet_Api_Strategy_V3($mailjet_username, $mailjet_password); - $response = $v3api->getMetaDataContact(); - return !empty($response->Count); - } - - /** - * Set the context of the Api - V1 or V3 - * - * @param WP_Mailjet_Api_Interface $context - * @return void - */ - private function setContext(WP_Mailjet_Api_Interface $context) - { - $this->context = $context; - } - - /** - * Clear the context - * - * @param void - * @return void - */ - private function clearContext() - { - $this->context = FALSE; - } - - public function findRecipient($params) - { - return $this->context->findRecipient($params); - } - - /** - * Get full list of senders - * - * @param (array) $param = array('limit', ...) - * @return (object) - */ - public function getSenders($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->getSenders($params); - } - - - public function updateContactData($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - return $this->context->updateContactData($params); - } - - /** - * Get full list of contact lists - * - * @param (array) $param = array('limit', ...) - * @return (object) - */ - public function getContactLists($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->getContactLists($params); - } - - /** - * Get list of user contact meta properties - * - * @param array - * @return object - */ - public function getContactMetaProperties($params) - { - if ($this->context === FALSE) { - return (object)array('Status' => 'ERROR'); - } - return $this->context->getContactMetaProperties($params); - } - - /** - * Create a new meta contact property - * - * @param array - * @return object - */ - public function createMetaContactProperty($params) - { - if ($this->context === FALSE) { - return (object)array('Status' => 'ERROR'); - } - return $this->context->createMetaContactProperty($params); - } - - /** - * Add a contact to a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function addContact($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->addContact($params); - } - - /** - * Remove a contact from a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function removeContact($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->removeContact($params); - } - - /** - * Unsubscribe a contact from a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function unsubContact($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->unsubContact($params); - } - - /** - * Subscribe a contact to a contact list with ID = ListID - * - * @param (array) $param = array('Email', 'ListID', ...) - * @return (object) - */ - public function subContact($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->subContact($params); - } - - /** - * Get the authentication token for the iframes - * - * @param (array) $param = array('APIKey', 'SecretKey', 'MailjetToken', ...) - * @return (object) - */ - public function getAuthToken($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->getAuthToken($params); - } - - - - - public function manageManyContacts($params) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->manageManyContacts($params); - } - - - /** - * Validate if $email is real email - * - * @param (string) $email - * @return (boolean) TRUE|FALSE - */ - public function validateEmail($email) - { - // Check if we have context, if no, return error - if ($this->context === FALSE) - return (object)array('Status' => 'ERROR'); - - return $this->context->validateEmail($email); - } -} \ No newline at end of file diff --git a/mailjet-class.php b/mailjet-class.php deleted file mode 100644 index a8d34be5..00000000 --- a/mailjet-class.php +++ /dev/null @@ -1,186 +0,0 @@ - array('locale' => 'en_US', 'label' => 'English'), - 'fr' => array('locale' => 'fr_FR', 'label' => 'French'), - 'de' => array('locale' => 'de_DE', 'label' => 'German'), - 'es' => array('locale' => 'es_ES', 'label' => 'Spanish'), - ); - - public function __construct($api, $phpMailer) - { - $this->pluginPath = dirname(__FILE__); - $chunks = explode(DIRECTORY_SEPARATOR, dirname(__FILE__)); - $this->pluginUrl = WP_PLUGIN_URL . '/' . end($chunks); - $this->api = $api; - $this->phpmailer = $phpMailer; - add_action('phpmailer_init', array($this, 'phpmailer_init_smtp')); - add_action('admin_menu', array($this, 'display_menu')); - add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); - } - - public function enqueue_scripts() - { - wp_enqueue_script('jquery-ui'); - wp_enqueue_script('jquery-ui-accordion'); - wp_enqueue_script('jquery-ui-tooltip'); - wp_enqueue_style('mailjet-jquery-ui', plugins_url('/assets/mailjet-jquery-ui.css', __FILE__)); - wp_enqueue_style('mailjet_css', plugins_url('/assets/mailjet.css', __FILE__)); - wp_register_script('mailjet_js', plugins_url('/assets/js/mailjet.js', __FILE__), array('jquery')); - wp_enqueue_script('mailjet_js'); - $this->addMjJsGlobalVar(); - } - - public function addMjJsGlobalVar() - { - $mjGlobalVars = array(); - $mjGlobalVarsProps = array(); - $mjWidgetDb = get_option('widget_wp_mailjet_subscribe_widget'); - if ($mjWidgetDb === false) { - return; - } - foreach ($this->langs as $lang => $langProps) { - foreach (array('metaProperty1' . $lang, 'metaPropertyName1' . $lang, 'metaProperty2' . $lang, 'metaPropertyName2' . $lang, - 'metaProperty3' . $lang, 'metaPropertyName3' . $lang) as $prop) { - foreach ($mjWidgetDb as $widgetId => $instance) { - if (!empty($instance[$prop])) { - $mjGlobalVars[$widgetId] = $instance[$prop]; - } - } - } - } - - foreach($mjWidgetDb as $widgetId => $instance){ - if (!is_array($instance)) { - continue; - } - foreach ($instance as $instanceKey => $prop){ - if (stristr($instanceKey, 'metaPropertyName')) { - $iLang = explode('metaPropertyName', $instanceKey); - if (!empty($instance['metaProperty' . $iLang[1]])) { - $mjGlobalVarsProps[$widgetId][$prop . substr($iLang[1], 1)] = $instance['metaProperty' . $iLang[1]]; - } - } - } - } - - ?> - - Mailer = 'smtp'; - $phpmailer->SMTPSecure = get_option('mailjet_ssl'); - - $phpmailer->Host = $this->api->mj_host; - $phpmailer->Port = get_option('mailjet_port'); - - $phpmailer->SMTPAuth = TRUE; - $phpmailer->Username = get_option('mailjet_username'); - $phpmailer->Password = get_option('mailjet_password'); - - $from_email = (get_option('mailjet_from_email') ? get_option('mailjet_from_email') : get_option('admin_email')); - $phpmailer->From = $from_email; - $phpmailer->Sender = $from_email; - - $phpmailer->FromName = get_option('mailjet_from_name') ? get_option('mailjet_from_name') : get_bloginfo('name'); - - $phpmailer->AddCustomHeader($this->api->mj_mailer); - } - - private function _get_auth_token() - { - // Get the - $token = $this->api->getAuthToken(array( - 'APIKey' => get_option('mailjet_username'), // Use any API Key from your Sub-accounts - 'SecretKey' => get_option('mailjet_password'), - 'MailjetToken' => get_option('mailjet_token' . $_SERVER['REMOTE_ADDR']) - )); - - // Return FALSE if there is token - if (isset($token->Status) && $token->Status == 'ERROR') - return FALSE; - - return $token; - } - - /** - * This method returns the current locale of the wordpress' user - */ - private function _get_locale() - { - $locale = get_locale(); - if (in_array($locale, array('de_DE', 'de_DE_formal'))) { - $locale = 'de_DE'; - } - if (!in_array($locale, array('fr_FR', 'en_US', 'en_GB', 'en_EU', 'de_DE', 'es_ES'))) { - $locale = 'en_US'; - } - return $locale; - } - - public function show_campaigns_menu() - { - echo '

    '; - echo __('Campaigns', 'wp-mailjet'); - echo '

    '; - echo ''; - } - - public function show_stats_menu() - { - echo '

    '; - echo __('Statistics', 'wp-mailjet'); - echo '

    '; - echo ''; - } - - public function show_contacts_menu() - { - echo '

    '; - echo __('Contacts', 'wp-mailjet'); - echo '

    '; - echo ''; - } -} \ No newline at end of file diff --git a/mailjet-options.php b/mailjet-options.php deleted file mode 100644 index 60bc0fa3..00000000 --- a/mailjet-options.php +++ /dev/null @@ -1,587 +0,0 @@ -pluginPath = dirname(__FILE__); - - // Set Plugin URL - $chunks = explode((string)DIRECTORY_SEPARATOR, dirname(__FILE__)); - $this->pluginUrl = WP_PLUGIN_URL . '/' . end($chunks); - - add_action('admin_menu', array($this, 'display_menu')); - } - - /** - * Display the Mailjet's plugin menu - * - * @param void - * @return void - */ - public function display_menu() - { - if ( - current_user_can('administrator') - || - (current_user_can('editor') && get_option('mailjet_access_editor') == 1) - || - (current_user_can('author') && get_option('mailjet_access_author') == 1) - || - (current_user_can('contributor') && get_option('mailjet_access_contributor') == 1) - || - (current_user_can('subscriber') && get_option('mailjet_access_subscriber') == 1) - ) { - add_menu_page( - __('Manage your mailjet lists and settings', 'wp-mailjet'), - 'Mailjet', - 'read', - 'wp_mailjet_options_top_menu', - array($this, 'show_settings_menu'), - plugin_dir_url(__FILE__) . '/assets/images/mj_logo_small.png' - ); - - if (function_exists('add_submenu_page')) - add_submenu_page('wp_mailjet_options_top_menu', __('Change your mailjet settings', 'wp-mailjet'), __('Settings', 'wp-mailjet'), 'read', 'wp_mailjet_options_top_menu', array($this, 'show_settings_menu')); - } - } - - /** - * Define the content of the Settings page - * - * @param void - * @return void - */ - public function show_settings_menu() - { - if (!empty($_POST)) { - $this->save_settings(); - } - - echo '

    '; - echo __('Mailjet Settings', 'wp-mailjet'); - echo '

    '; - echo '
    -

    ' . __('Share the love!', 'wp-mailjet') . '

    -
    - -
    -
    - -
    -
    -
    '; - - $form = new WP_Mailjet_Options_Form('admin.php?page=wp_mailjet_options_top_menu&action=save_options'); - - $desc = '
      '; - $desc .= '
    1. ' . sprintf(__('Create your Mailjet account if you don\'t have any.', 'wp-mailjet'), 'wordpress-3.0') . '
    2. '; - $desc .= '
    3. ' . __('Log in with your account through the login form below or visit your account page to get your API keys and set up them below.', 'wp-mailjet') . '
    4. '; - $desc .= '
    5. ' . __('Create a new list if you don\'t have one or need a new one.', 'wp-mailjet') . '
    6. '; - $desc .= '
    7. ' . __('Add the email collection widget to your sidebar or footer.', 'wp-mailjet') . '
    8. '; - $desc .= '
    9. ' . __('Create a campaign on mailjet.com to send your newsletter.', 'wp-mailjet') . '
    10. '; - $desc .= '
    11. ' . __('Should you have any questions or encounter any difficulties, please consult our User Guide or contact our technical Support Team', 'wp-mailjet') . '
    12. '; - $desc .= '
    '; - - $generalFieldset = new WP_Mailjet_Options_Form_Fieldset( - __('Mailjet Plugin', 'wp-mailjet'), - array(), - $desc, - true - ); - - $form->addFieldset($generalFieldset); - - /* Api field set */ - $apiOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_username', __('API key', 'wp-mailjet'), 'text', get_option('mailjet_username'), null, TRUE); - $apiOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_password', __('Secret key', 'wp-mailjet'), 'text', get_option('mailjet_password'), null, TRUE); - - $apiFieldset = new WP_Mailjet_Options_Form_Fieldset( - __('API Settings', 'wp-mailjet'), - $apiOptions, - sprintf(__('You can get your API keys from your mailjet account. Please also make sure the sender address %s is active in your account', 'wp-mailjet'), get_option('admin_email')), - true - ); - - $form->addFieldset($apiFieldset); - /* END - Api field set */ - - - /* General field set */ - $generalOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_enabled', ' ' . __('Enabled', 'wp-mailjet'), - 'checkbox', get_option('mailjet_enabled'), __('Enable email through Mailjet', 'wp-mailjet')); - - $generalOptions[] = new WP_Mailjet_Options_Form_Option( - 'mailjet_ssl', - ' ' . __('SSL Enabled (only with port 465)', 'wp-mailjet'), - 'checkbox', get_option('mailjet_ssl'), - __('Enable SSL communication with mailjet.com', 'wp-mailjet') - ); - - $ports = array( - array('value' => 25, 'label' => 25), - array('value' => 465, 'label' => 465), - array('value' => 587, 'label' => 587), - array('value' => 588, 'label' => 588), - array('value' => 80, 'label' => 80), - ); - - $generalOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_port', '', 'select', get_option('mailjet_port'), - __('Port to use for SMTP communication', 'wp-mailjet'), FALSE, $ports); - - $generalOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_test', ' ' . __('Send test email', 'wp-mailjet'), - 'checkbox', get_option('mailjet_test'), __('Send test email now', 'wp-mailjet')); - - $test_email = (get_option('mailjet_test_address') ? get_option('mailjet_test_address') : get_option('admin_email')); - - $generalOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_test_address', - __('Recipient of test email', 'wp-mailjet'), 'email', $test_email); - - $from_email = (get_option('mailjet_from_email') ? get_option('mailjet_from_email') : get_option('admin_email')); - - $generalOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_from_email', __('From: email address', - 'wp-mailjet'), 'email', $from_email); - - $from_name = (get_option('mailjet_from_name') ? get_option('mailjet_from_name') : ''); - - $generalOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_from_name', __('From: Name', 'wp-mailjet'), 'text', $from_name, null, TRUE); - -// General settings - $generalFieldset = new WP_Mailjet_Options_Form_Fieldset( - __('General Settings', 'wp-mailjet'), - $generalOptions, - __('Enable or disable the sending of your emails through your Mailjet account', 'wp-mailjet'), - true - ); - - $form->addFieldset($generalFieldset); - /* END - General field set */ - - - if (get_option('mailjet_password') && get_option('mailjet_username')) { - // Get the list of contact lists and order them in a properly set list - $this->api = new WP_Mailjet_Api(get_option('mailjet_username'), get_option('mailjet_password')); - $resp = $this->api->getContactLists(array('limit' => 0)); - -// Initial Sync - // get the name of the preselected contact list - $lastSyncMessage = __('Initial sync not yet executed, choose a list and save settings to start it', 'wp-mailjet'); - $lastSyncedContactListName = ''; - $lastSyncedDate = ''; - $initialSyncStatus = 'Inactive'; - if (is_array($resp)) { - foreach ($resp as $contactList) { - if ($contactList['value'] == get_option('mailjet_initial_sync_last_list_id')) { - $lastSyncedContactListName = $contactList['label']; - } - } - if (get_option('mailjet_initial_sync_last_date')) { - $lastSyncedDate = get_option('mailjet_initial_sync_last_date'); - } - if (get_option('mailjet_initial_sync_list_id')) { - $initialSyncStatus = 'Active'; - } - - if (!empty($lastSyncedContactListName) && !empty($lastSyncedDate) && !empty($initialSyncStatus)) { - $lastSyncMessage = sprintf(__('Initial users sync is %s! Existing contacts subscribed to %s on %s', 'wp-mailjet'), $initialSyncStatus, $lastSyncedContactListName, $lastSyncedDate); - } - } - - $desc = '
      '; - $desc .= '
    • ' . sprintf(__('Choose a Mailjet contact list which you would like to subscribe your Wordpress users to.', 'wp-mailjet')) . '
    • '; - $desc .= '
    • ' . $lastSyncMessage . '
    • '; - $desc .= '
    '; - - $lists = array(array('value' => '', 'label' => __('Disable initial sync', 'wp-mailjet'))); - if (!(isset($resp->Status) && $resp->Status == 'ERROR') && count($resp) > 0) { - usort($resp, array($this, 'sortByLabel')); - $lists = array_merge($lists, $resp); - } - - $syncOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_initial_sync_list_id', '', 'select', - get_option('mailjet_initial_sync_list_id'), __('Subscribe existing users to this list', 'wp-mailjet'), FALSE, $lists); - -// Auto subscribe - $lists = array(array('value' => '', 'label' => __('Disable autosubscribe', 'wp-mailjet'))); - if (!(isset($resp->Status) && $resp->Status == 'ERROR') && count($resp) > 0) { - usort($resp, array($this, 'sortByLabel')); - $lists = array_merge($lists, $resp); - } - - $syncOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_auto_subscribe_list_id', '', 'select', - get_option('mailjet_auto_subscribe_list_id'), __('Auto subscribe new users to this list', 'wp-mailjet'), FALSE, $lists); - - - $syncFieldset = new WP_Mailjet_Options_Form_Fieldset( - __('Subscribe Wordpress users', 'wp-mailjet'), - $syncOptions, - $desc, - true - ); - - $form->addFieldset($syncFieldset); - - -// Comment Authors - - - // get the name of the preselected contact list - $lastSyncMessage = __('Comment author sync not yet activated, choose a list and save settings to activate it', 'wp-mailjet'); - $lastSyncedContactListName = ''; - $lastSyncedDate = ''; - $commentAuthorsSyncStatus = 'Inactive'; - if (is_array($resp)) { - foreach ($resp as $contactList) { - if ($contactList['value'] == get_option('mailjet_comment_authors_last_list_id')) { - $lastSyncedContactListName = $contactList['label']; - } - } - if (get_option('mailjet_comment_authors_list_date')) { - $lastSyncedDate = get_option('mailjet_comment_authors_list_date'); - } - if (get_option('mailjet_comment_authors_list_id')) { - $commentAuthorsSyncStatus = 'Active'; - } - if (!empty($lastSyncedContactListName) && !empty($lastSyncedDate) && !empty($commentAuthorsSyncStatus)) { - $lastSyncMessage = sprintf(__('Comment authors sync is %s!', 'wp-mailjet'), $commentAuthorsSyncStatus); - } - } - - - $desc = '
      '; - $desc .= '
    • ' . sprintf(__('This feature adds a "Subscribe to our mailing list" checkbox in the "Leave a reply" form, so that comment authors can automatically join a contact list of your choice.', 'wp-mailjet')) . '
    • '; - $desc .= '
    • ' . $lastSyncMessage . '
    • '; - $desc .= '
    '; - - $lists = array(array('value' => '', 'label' => __('Disable comment authors subscription', 'wp-mailjet'))); - if (!(isset($resp->Status) && $resp->Status == 'ERROR') && count($resp) > 0) { - usort($resp, array($this, 'sortByLabel')); - $lists = array_merge($lists, $resp); - } - - $commentAuthorsOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_comment_authors_list_id', '', 'select', - get_option('mailjet_comment_authors_list_id'), __('Allow comment authors to subscribe to this list', 'wp-mailjet'), FALSE, $lists); - - $commentAuthorsFieldset = new WP_Mailjet_Options_Form_Fieldset( - __('Subscribe comment authors', 'wp-mailjet'), - $commentAuthorsOptions, - $desc, - true - ); - - $form->addFieldset($commentAuthorsFieldset); - } - - - /* Add access field set */ - if (current_user_can('administrator')) { - $accessOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_access_administrator', ' ' . __('Administrator', 'wp-mailjet'), 'checkbox', TRUE, __('User roles able to access the plugin', 'wp-mailjet'), TRUE, null, TRUE); - $accessOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_access_editor', ' ' . __('Editor', 'wp-mailjet'), 'checkbox', get_option('mailjet_access_editor'), ''); - $accessOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_access_author', ' ' . __('Author', 'wp-mailjet'), 'checkbox', get_option('mailjet_access_author'), ''); - $accessOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_access_contributor', ' ' . __('Contributor', 'wp-mailjet'), 'checkbox', get_option('mailjet_access_contributor'), ''); - $accessOptions[] = new WP_Mailjet_Options_Form_Option('mailjet_access_subscriber', ' ' . __('Subscriber', 'wp-mailjet'), 'checkbox', get_option('mailjet_access_subscriber'), ''); - - $accessFieldset = new WP_Mailjet_Options_Form_Fieldset( - __('Access Settings', 'wp-mailjet'), - $accessOptions, - __('Select which WordPress admin user roles (in addition to Administrator) will also have access to the Mailjet Plug-in', 'wp-mailjet'), - true - ); - - $form->addFieldset($accessFieldset); - } - /* END - Add access field set */ - - $form->display(); - echo '
    '; - } - - private function sortByLabel($a, $b) - { - $a = $a['label']; - $b = $b['label']; - - if ($a == $b) return 0; - return ($a < $b) ? -1 : 1; - } - - public function hasValidSender($from_email, $senders) - { - if (!empty($senders->Status) && $senders->Status === 'ERROR') { - return false; - } - $domainArr = explode('@', $from_email); - $domainName = array_pop($domainArr); - return (in_array($from_email, $senders['email']) || in_array($domainName, $senders['domain'])); - } - - /** - * Save the Mailjet's plugin settings when we click "Save options" button - * - * @param void - * @return void - */ - public function save_settings() - { - // Get the variables which we'll save - $fields['mailjet_enabled'] = (isset($_POST['mailjet_enabled']) ? 1 : 0); - $fields['mailjet_test'] = (isset($_POST['mailjet_test']) ? 1 : 0); - $fields['mailjet_ssl'] = (isset($_POST['mailjet_ssl']) ? 'ssl' : ''); - $fields['mailjet_test_address'] = strip_tags(filter_var($_POST['mailjet_test_address'], FILTER_VALIDATE_EMAIL)); - $fields['mailjet_from_email'] = strip_tags(filter_var($_POST['mailjet_from_email'], FILTER_VALIDATE_EMAIL)); - $fields['mailjet_from_name'] = strip_tags(filter_var($_POST['mailjet_from_name'], FILTER_SANITIZE_STRING)); - $fields['mailjet_username'] = trim(strip_tags(filter_var($_POST['mailjet_username'], FILTER_SANITIZE_STRING))); - $fields['mailjet_password'] = trim(strip_tags(filter_var($_POST['mailjet_password'], FILTER_SANITIZE_STRING))); - $fields['mailjet_port'] = strip_tags(filter_var($_POST['mailjet_port'], FILTER_SANITIZE_NUMBER_INT)); - $fields['mailjet_initial_sync_list_id'] = ($fields['mailjet_username'] != get_option('mailjet_username') || $fields['mailjet_password'] != get_option('mailjet_password')) - ? false - : strip_tags(filter_var($_POST['mailjet_initial_sync_list_id'], FILTER_SANITIZE_NUMBER_INT)); - $fields['mailjet_comment_authors_list_id'] = ($fields['mailjet_username'] != get_option('mailjet_username') || $fields['mailjet_password'] != get_option('mailjet_password')) - ? false - : strip_tags(filter_var($_POST['mailjet_comment_authors_list_id'], FILTER_SANITIZE_NUMBER_INT)); - $fields['mailjet_auto_subscribe_list_id'] = ($fields['mailjet_username'] != get_option('mailjet_username') || $fields['mailjet_password'] != get_option('mailjet_password')) - ? false - : strip_tags(filter_var($_POST['mailjet_auto_subscribe_list_id'], FILTER_SANITIZE_NUMBER_INT)); - if (current_user_can('administrator')) { - $fields['mailjet_access_editor'] = (isset($_POST['mailjet_access_editor']) ? 1 : 0); - $fields['mailjet_access_author'] = (isset($_POST['mailjet_access_author']) ? 1 : 0); - $fields['mailjet_access_contributor'] = (isset($_POST['mailjet_access_contributor']) ? 1 : 0); - $fields['mailjet_access_subscriber'] = (isset($_POST['mailjet_access_subscriber']) ? 1 : 0); - } - - // Set error messages if we've any - $errors = array(); - if ($fields['mailjet_test'] && empty($fields['mailjet_test_address'])) { - $errors[] = 'mailjet_test_address'; - } - - if (!empty($fields['mailjet_test_address'])) { - if (!filter_var($fields['mailjet_test_address'], FILTER_VALIDATE_EMAIL)) { - $errors[] = 'mailjet_test_address'; - } - } - - if (empty($fields['mailjet_username'])) { - $errors[] = 'mailjet_username'; - } - - if (empty($fields['mailjet_password'])) { - $errors[] = 'mailjet_password'; - } - - // If there are no errors, then update the new settings - if (!count($errors)) { - if ($fields['mailjet_ssl'] == 'ssl') { - $fields['mailjet_port'] = 465; - } - - // Update the new settings - update_option('mailjet_enabled', $fields['mailjet_enabled']); - update_option('mailjet_token' . $_SERVER['REMOTE_ADDR'], json_encode(array('timestamp' => 0))); - update_option('mailjet_test', $fields['mailjet_test']); - update_option('mailjet_test_address', $fields['mailjet_test_address']); - update_option('mailjet_from_email', $fields['mailjet_from_email']); - update_option('mailjet_from_name', $fields['mailjet_from_name']); - update_option('mailjet_ssl', $fields['mailjet_ssl']); - update_option('mailjet_port', $fields['mailjet_port']); - if (!empty($fields['mailjet_initial_sync_list_id'])) { - update_option('mailjet_initial_sync_last_list_id', $fields['mailjet_initial_sync_list_id']); - update_option('mailjet_initial_sync_last_date', current_time("Y-m-d H:i:s ")); - } - update_option('mailjet_initial_sync_list_id', $fields['mailjet_initial_sync_list_id']); - if (!empty($fields['mailjet_comment_authors_list_id'])) { - update_option('mailjet_comment_authors_last_list_id', $fields['mailjet_comment_authors_list_id']); - update_option('mailjet_comment_authors_list_date', current_time("Y-m-d H:i:s ")); - } - update_option('mailjet_comment_authors_list_id', $fields['mailjet_comment_authors_list_id']); - update_option('mailjet_auto_subscribe_list_id', $fields['mailjet_auto_subscribe_list_id']); - if (current_user_can('administrator')) { - update_option('mailjet_access_editor', $fields['mailjet_access_editor']); - update_option('mailjet_access_author', $fields['mailjet_access_author']); - update_option('mailjet_access_contributor', $fields['mailjet_access_contributor']); - update_option('mailjet_access_subscriber', $fields['mailjet_access_subscriber']); - } - - // Establish API connection because we will need it to check if the API and secrect keys are correct - $this->api = new WP_Mailjet_Api($fields['mailjet_username'], $fields['mailjet_password']); - update_option('mailjet_user_api_version', - $this->api->findUserApiVersion($fields['mailjet_username'], $fields['mailjet_password'])); - // get proper instance of the API class, after user API DB version update - $this->api = new WP_Mailjet_Api($fields['mailjet_username'], $fields['mailjet_password']); - - // Check if there is a connection with the Mailjet's server - $configs = array( - array('', 25), - array('tls', 25), - array('ssl', 465), - array('tls', 587), - array('', 587), - array('', 588), - array('', 80), - ); - - $connected = FALSE; - $protocol = ''; - if (get_option('mailjet_ssl')) { - $protocol = 'ssl://'; - } - - $soc = @fsockopen($protocol . $this->api->mj_host, get_option('mailjet_port'), $errno, $errstr, 5); - - if ($soc) { - $connected = TRUE; - $port = get_option('mailjet_port'); - $ssl = get_option('mailjet_ssl'); - } else { - for ($i = 0; $i < count($configs); ++$i) { - if ($configs[$i][0]) - $protocol = $configs[$i][0] . '://'; - else - $protocol = ''; - - $soc = @fsockopen($protocol . $this->api->mj_host, $configs[$i][1], $errno, $errstr, 5); - if ($soc) { - fclose($soc); - $connected = $i; - $port = $configs[$i][1]; - $ssl = $configs[$i][0]; - break; - } - } - } - - // Get all senders - $senders = $this->api->getSenders(array('limit' => 0)); - $from_email = $fields['mailjet_from_email'] ? $fields['mailjet_from_email'] : get_option('admin_email'); - - // If there is connection, display successful message - if ($connected !== FALSE) { - - if(!$this->hasValidSender($from_email, $senders)) { - WP_Mailjet_Utils::custom_notice('error', __('Please make sure that you are using the correct API key and secret key associated to your mailjet account (from email).', 'wp-mailjet')); - } - // Record API and secret keys in WP DB only on successful connect - update_option('mailjet_ssl', $ssl); - update_option('mailjet_port', $port); - update_option('mailjet_username', $fields['mailjet_username']); - update_option('mailjet_password', $fields['mailjet_password']); - - $test_sent = FALSE; - - if (!empty($fields['mailjet_test_address']) && - !empty($fields['mailjet_test']) && - $this->hasValidSender($from_email, $senders) - ) { - // Send a test mail - $subject = __('Your test mail from Mailjet', 'wp-mailjet'); - $message = sprintf(__('Your Mailjet configuration is ok!' . 'SSL: %s Port: %s', 'wp-mailjet'), ($ssl ? 'On' : 'Off'), $port); - $enabled = get_option('mailjet_enabled'); - update_option('mailjet_enabled', 1); - $test_sent = wp_mail($fields['mailjet_test_address'], $subject, $message); - update_option('mailjet_enabled', $enabled); - } - - $sent = ''; - if ($test_sent) { - $sent = __(' and your test message was sent.', 'wp-mailjet'); - } - - if ($connected === TRUE) { - $domainsArray = explode('@', $from_email); - $domainName = array_pop($domainsArray); - if (!in_array($from_email, $senders['email']) && !in_array($domainName, $senders['domain'])) - WP_Mailjet_Utils::custom_notice('updated', __('Your settings have been saved successfully', 'wp-mailjet') . '.'); - else - WP_Mailjet_Utils::custom_notice('updated', __('Your settings have been saved successfully', 'wp-mailjet') . $sent); - } elseif ($connected >= 0) { - WP_Mailjet_Utils::custom_notice('updated', __('Your settings have been saved, but your port and SSL settings were changed as follows to ensure delivery', 'wp-mailjet') . $sent); - } - - if (intval(get_option('mailjet_initial_sync_list_id')) > 0) { - $this->syncAllWpUsers(); - } - - } else { - // Error message - $link = 'https://www.mailjet.com/account/api_keys'; - WP_Mailjet_Utils::custom_notice('error', sprintf(__('Please verify that you have entered your API and secret key correctly. If this is the case and you have still this error message, please go to Account API keys (%s) to regenerate a new Secret Key for the plug-in.', 'wp-mailjet'), $link, $link)); - } - } else { - // Error message - WP_Mailjet_Utils::custom_notice('error', __('There is an error with your settings. please correct and try again', 'wp-mailjet')); - } - } - - - public function syncAllWpUsers() - { - $this->api->createMetaContactProperty(array( - 'name' => 'first_name', - 'dataType' => 'str' - )); - $this->api->createMetaContactProperty(array( - 'name' => 'last_name', - 'dataType' => 'str' - )); - $resp = $this->api->createMetaContactProperty(array( - 'name' => 'wp_user_role', - 'dataType' => 'str' - )); - - $contacts = array(); - $users = get_users(array('fields' => array('ID', 'user_email'))); - - if ($users) { - foreach ($users as $user) { - $userInfo = get_userdata($user->ID); - $userRoles = $userInfo->roles; - $userMetadata = get_user_meta($user->ID); - - $contactProperties = array(); - if (!empty($userMetadata['first_name'][0])) { - $contactProperties['first_name'] = $userMetadata['first_name'][0]; - } - if (!empty($userMetadata['last_name'][0])) { - $contactProperties['last_name'] = $userMetadata['last_name'][0]; - } - if (!empty($userRoles[0])) { - $contactProperties['wp_user_role'] = $userRoles[0]; - } - - $contacts[] = array( - 'Email' => $user->user_email, - 'Properties' => $contactProperties - ); - } - } - - $this->asyncManageContactsToList($contacts, get_option('mailjet_initial_sync_list_id'), 'addnoforce'); - } - - - - - public function asyncManageContactsToList($contacts, $list_id, $action = 'addnoforce') - { - $params = array( - "listId" => $list_id, - "action" => $action, - "contacts" => $contacts - ); - - $asyncJobResponse = $this->api->manageManyContacts($params); - - return $asyncJobResponse; - - } -} diff --git a/mailjet-utils.php b/mailjet-utils.php deleted file mode 100755 index 6853a815..00000000 --- a/mailjet-utils.php +++ /dev/null @@ -1,17 +0,0 @@ -

    ' . $message . '

    '; - } -} \ No newline at end of file diff --git a/mailjet-widget.php b/mailjet-widget.php deleted file mode 100755 index 7dc0f62c..00000000 --- a/mailjet-widget.php +++ /dev/null @@ -1,769 +0,0 @@ - array('locale' => 'en_US', 'label' => 'English'), - 'fr' => array('locale' => 'fr_FR', 'label' => 'French'), - 'de' => array('locale' => 'de_DE', 'label' => 'German'), - 'es' => array('locale' => 'es_ES', 'label' => 'Spanish'), - ); - - const MAX_META_PROPERTIES = 3; - const WIDGET_HASH = '[\^=l|>5i!? {xI'; - - public function __construct() - { - // Set Plugin URL - $chunks = explode(DIRECTORY_SEPARATOR, dirname(__FILE__)); - $this->pluginUrl = WP_PLUGIN_URL . '/' . end($chunks); - - $this->locale = get_locale(); - - if (in_array($this->locale, array('en_US', 'en_EN'))) { - $this->locale = 'en_EN'; - } - if (in_array($this->locale, array('de_DE', 'de_DE_formal'))) { - $this->locale = 'de_DE'; - } - //No dependency injection possible, so we have to use this: - $this->api = new WP_Mailjet_Api(get_option('mailjet_username'), get_option('mailjet_password')); - $widget_description = __('Allows your visitors to subscribe to one of your lists', 'wp-mailjet'); - - $widget_ops = array( - 'classname' => 'WP_Mailjet_Subscribe_Widget', - 'description' => $widget_description - ); - $mailjet_widget_name = __('Mailjet Subscription widget', 'wp-mailjet'); - parent::__construct(FALSE, $mailjet_widget_name, $widget_ops); - add_action('wp_ajax_mailjet_subscribe_ajax_hook', array($this, 'mailjet_subscribe_from_widget')); - add_action('wp_ajax_nopriv_mailjet_subscribe_ajax_hook', array($this, 'mailjet_subscribe_from_widget')); - add_action('wp_ajax_mailjet_subscribe_ajax_add_meta_property', - array($this, 'wp_ajax_mailjet_subscribe_ajax_add_meta_property')); - - require_once dirname(__FILE__) . '/libs/PHP-po-parser-master/src/Sepia/InterfaceHandler.php'; - require_once dirname(__FILE__) . '/libs/PHP-po-parser-master/src/Sepia/FileHandler.php'; - require_once dirname(__FILE__) . '/libs/PHP-po-parser-master/src/Sepia/PoParser.php'; - - foreach ($this->langs as $lang => $langProps) { - $fileHandler = new FileHandler(dirname(__FILE__) . '/i18n/wp-mailjet-subscription-widget-' . $langProps['locale'] . '.po'); - $this->{'poParser' . $lang} = new PoParser($fileHandler); - $this->{'entries' . $lang} = $this->{'poParser' . $lang}->parse(); - } - - // if user clicks on the email confirm subscription link, verify the token and subscribe them - if (!empty($_GET['mj_sub_token'])) { - $this->subscribeUser(); - } - } - - function wp_ajax_mailjet_subscribe_ajax_add_meta_property() - { - if (!empty($_REQUEST['name']) && !empty($_REQUEST['type'])) { - echo json_encode($this->api->createMetaContactProperty(array( - 'name' => $_REQUEST['name'], - 'dataType' => $_REQUEST['type'] - ))); - } - die; - } - - /** - * Get list of contact lists - * - * @param void - * @return (array) $this->lists - */ - function getLists() - { - if ($this->lists === FALSE) { - $this->lists = $this->api->getContactLists(array('limit' => 0)); - if (isset($this->lists->Status) && $this->lists->Status == 'ERROR') { - $this->lists = array(); - } - } - return $this->lists; - } - - function getContactMetaProperties($showMsg = true) - { - $response = $this->api->getContactMetaProperties(array( - 'method' => 'GET', - 'limit' => 0 - )); - $this->_userVersion = 3; - if (empty($response)) { - if ($showMsg === true) { - echo '

    '; - echo __('You are either v1 user or we could not fetch user contact properties. Please contact our support team to discuss migrating to v3 user where you will have contact properties available. You can still configure a Mailjet subscription widget by clicking on "Next" button and complete step2 and step3.', - 'wp-mailjet'); - echo '

    '; - } - $this->_userVersion = 1; - } - return $response; - } - - function preg_array_key_exists($pattern, $array) - { - return (int)preg_grep($pattern, array_keys($array)); - } - - function form($instance) - { - global $WPMailjet; - - // if there are translation entries in the POST, update them - if ($this->preg_array_key_exists('/msgstr/', $_POST)) { - require_once(dirname(__FILE__) . '/libs/php.mo-master/php-mo.php'); - foreach ($this->langs as $lang => $locale) { - foreach ($_POST as $key => $value) { - if (substr($key, 0, 7) === 'msgstr-') { - foreach ($this->{'entries' . $lang} as $entryKey => $entryValue) { - if ($this->entryStrToId($entryKey) === str_replace('msgstr-' . $lang . '-', '', $key)) { - $this->{'entries' . $lang}[$entryKey]['msgstr'][0] = stripcslashes($_POST[$key]); - $this->{'poParser' . $lang}->setEntry($entryKey, $this->{'entries' . $lang}[$entryKey]); - } - } - } - } - } - foreach ($this->langs as $lang => $locale) { - $this->{'poParser' . $lang}->writeFile(dirname(__FILE__) . '/i18n/wp-mailjet-subscription-widget-' . $locale['locale'] . '.po'); - phpmo_convert(dirname(__FILE__) . '/i18n/wp-mailjet-subscription-widget-' . $locale['locale'] . '.po'); - } - if (in_array(get_locale(), array('en_US', 'en_EN', ''))) { - foreach (array('-en_US', '-en_EN', '') as $lang) { - $this->poParseren->writeFile(dirname(__FILE__) . '/i18n/wp-mailjet-subscription-widget' . $lang . '.po'); - phpmo_convert(dirname(__FILE__) . '/i18n/wp-mailjet-subscription-widget' . $lang . '.po'); - } - } - } - - $fields = array('new_meta_name', 'new_meta_data_type'); - $langFields = array('enableTab', 'title', 'list_id', 'button_text', 'metaPropertyName1', 'metaPropertyName2', - 'metaPropertyName3', 'metaProperty1', 'metaProperty2', 'metaProperty3' - ); - foreach ($fields as $prop) { - ${$prop} = empty($instance[$prop]) ? '' : $instance[$prop]; - } - foreach ($langFields as $prop) { - foreach ($this->langs as $lang => $langProps) { - ${$prop . $lang} = empty($instance[$prop . $lang]) ? '' : $instance[$prop . $lang]; - } - } - ?> -
    -
    -

    Step 1 - Choose up to 3 contact properties

    -
    - getContactMetaProperties(); - if ($this->_userVersion === 3) { - ?> - Data)) { ?> -
    - - - -
    -
    Available contact properties
    - -
    Data)) { ?> style="display:none;" > -
    -
      - Data as $prop) { - $lang = 'en'; - //foreach($this->langs as $lang => $langProps) { - if (!in_array($prop->Name, - array(${'metaPropertyName1' . $lang}, ${'metaPropertyName2' . $lang}, - ${'metaPropertyName3' . $lang} - )) - ) { ?> -
    • -
          Name; ?> -
    • - -
    -
    -
    -
    Selected properties
    -
    Arrange and sort the properties you selected to determine the - way they will be shown in the widget. -
    -
      -
    • Email address (mandatory)
    • - - -
    • -
           -
    • - - - -
    -
    -
    - -
    -
    Add New Property
    -
    Click on the button below to dynamically add a new contact property to your contact - list and widget. -
    -
      -
    • Add a new property
    • -
    - -
    Property created. Please drag your new contact property to the - Selected Properties section above. -
    - -
    -
    -
    -
    - -
    -
    -
    - -
    -

    - - -

    -
    -
    - -

    - -

    -
    - -

    Step 2 - Define your widget labels

    -
    -
    -
      - langs as $lang => $langProps) { ?> -
    • - -
    • - -
    -
    - langs as $lang => $langProps) { ?> -
    -
    - /> - -
    - -
    Please enter specific labels for your subscription widget - and they - will be displayed on the front end of your website. -
    - _userVersion === 3) { ?> -
    - -
    - - - -
    - -
    - -

    - -

    -

    - -

    -

    - -

    -
    - -
    -

    - - -

    -
    -
    - -

    Step 3 - Customize your widget notifications

    -
    -
    -
      - langs as $lang => $langProps) { ?> -
    • - -
    • - -
    -
    - langs as $lang => $langProps) { ?> -
    -
    -
    Widget notifications for this language are - deactivated in - previous step -
    - Customize - your widget notifications
    -
    - {'entries' . $lang} as $msgid => $msg) { - $id = $this->entryStrToId($msgid); - $i++; - if ($i === 1) { - ?> -

    Errors/Website notifications

    - - -

    Subscription confirmation mail

    - -
    -
    - -
    - -
    -
    - -
    -

    -
    -
    -
    -
    - 0) { ?> -
    - addMjJsGlobalVar(); - } - - function entryStrToId($str) - { - return substr(str_replace(array(' ', '%', ':', '/', '<', '>', '"', '\\', '@', '.', '!', '?'), array('-'), $str), - 0, 20); - } - - function update($new_instance, $old_instance) - { - return $new_instance; - } - - /** - * Checks if the string argument is integer. - * @param string $input - * @return bool - */ - function mj_is_int($input) - { - return ctype_digit(strval($input)); - } - - /** - * Checks if the string argument is float. - * @param string $input - * @return bool - */ - function mj_is_float($input) - { - return $input === (string)(float)$input; - } - - function mj_is_datetime($input) - { - return true; // skip that check since we perform DateTime validation - } - - /** - * Check if given date is a valid one - * - * @param $string - * @return bool - */ - function mj_isValidDate($string) - { - try { - new \DateTime($string); - $lastError = \DateTime::getLastErrors(); - return $lastError['warning_count'] == 0 && $lastError['error_count'] == 0; - } catch (\Exception $e) { - return false; - } - return false; - } - - /** - * Checks if the string argument is boolean. - * @param string $input - * @return bool - */ - function mj_is_bool($input) - { - return in_array(strtolower($input), array('1', 't', 'true', 'y', '0', 'f', 'false', 'n')); - } - - /** - * Email the collected widget data to the customer with a verification token - * @param void - * @return void - */ - public function mailjet_subscribe_from_widget() - { - load_plugin_textdomain('wp-mailjet', FALSE, dirname(plugin_basename(__FILE__)) . '/i18n'); - // load_plugin_textdomain('wp-mailjet-subscription-widget', FALSE, dirname(plugin_basename(__FILE__)) . '/i18n'); - - $error = empty($_POST['email']) ? 'Email field is empty' : false; - if (empty($_POST['email'])) { - echo __('Email field is empty', 'wp-mailjet'); - die; - } - - if (empty($_POST['list_id'])) { - echo __('Missing list id', 'wp-mailjet'); - die; - } - - if (!$this->validate_email($_POST['email'])) { - _e('Invalid email', 'wp-mailjet'); - die; - } - - $recipient = $this->api->findRecipient(array( - 'ContactsList' => $_POST['list_id'], - 'ContactEmail' => $_POST['email'], - )); - if (!empty($recipient->Count) || $recipient === true) { - echo '

    '; - echo sprintf(__("The contact %s is already subscribed", 'wp-mailjet'), $_POST['email']); - echo '

    '; - die; - } - - $metaProperties = $this->getContactMetaProperties(false); - - if (!empty($metaProperties->Count) && !empty($metaProperties->Data)) { - // check if the input from contact meta properties matches the data type of each property - // apiDataType => phpCheckFunction - $dataTypes = array( - 'int' => 'mj_is_int', - 'float' => 'mj_is_float', - 'bool' => 'mj_is_bool', - 'datetime' => 'mj_is_datetime' - ); - $error = false; - $submittedProperties = array_diff(array_keys($_POST), array('email', 'list_id', 'action')); - foreach ($metaProperties->Data as $accountProperty) { - foreach ($submittedProperties as $submittedProperty) { - if ($accountProperty->Datatype === 'str') { - continue; - } - - $dataTypeFunction = $dataTypes[$accountProperty->Datatype]; - if ($accountProperty->Name === $submittedProperty && - $this->$dataTypeFunction($_POST[$submittedProperty]) !== true - ) { - _e('You have entered a contact property with wrong data type, for example a string instead of a number.', - 'wp-mailjet'); - die; - } - - // convert inserted date time property to unix timestamp - if ($accountProperty->Name === $submittedProperty && $accountProperty->Datatype === 'datetime') { - // Fix for strtotime() when parsing format dd/mm/yyyy - $_POST[$submittedProperty] = str_replace('/', '-', $_POST[$submittedProperty]); - if (false === $this->mj_isValidDate($_POST[$submittedProperty])) { - _e('You have entered a Datetime contact property with Invalid date value. Valid format for date time property is "dd-mm-YYYY" or "dd/mm/YYYY".', - 'wp-mailjet'); - die; - } - $_POST[$submittedProperty] = strtotime($_POST[$submittedProperty]); - } - } - } - } - - $params = http_build_query($_POST); - $filename = apply_filters('mailjet_confirmation_email_filename', - dirname(__FILE__) . '/templates/confirm-subscription-email.php'); - $message = file_get_contents($filename); - $wpUrl = sprintf('%s', get_home_url(), get_home_url()); - $emailData = array( - '__EMAIL_TITLE__' => __('Confirm your mailing list subscription', 'wp-mailjet'), - '__EMAIL_HEADER__' => sprintf(__('Please Confirm Your Subscription To', 'wp-mailjet'), $wpUrl), - '__WP_URL__' => $wpUrl, - '__CONFIRM_URL__' => get_home_url() . '?' . $params . '&mj_sub_token=' . sha1($params . self::WIDGET_HASH), - '__CLICK_HERE__' => __('Click here to confirm', 'wp-mailjet'), - '__COPY_PASTE_LINK__' => __('You may copy/paste this link into your browser:', 'wp-mailjet'), - '__FROM_NAME__' => get_option('blogname'), - '__IGNORE__' => __('Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed', - 'wp-mailjet'), - '__THANKS__' => __('Thanks,', 'wp-mailjet') - ); - $emailParams = apply_filters('mailjet_subscription_widget_email_params', $emailData); - foreach ($emailParams as $key => $value) { - $message = str_replace($key, $value, $message); - } - add_filter('wp_mail_content_type', create_function('', 'return "text/html"; ')); - $result = wp_mail($_POST['email'], __('Subscription Confirmation', 'wp-mailjet'), $message, - array('From: ' . get_option('blogname') . ' <' . get_option('admin_email') . '>')); - echo '

    ' . __('Subscription confirmation email sent. Please check your inbox and confirm the subscription.', - 'wp-mailjet') . '

    '; - die; - } - - /** - * Subscribe the user from the widget - */ - function subscribeUser() - { - // validate token - $mj_sub_token = $_GET['mj_sub_token']; - unset($_GET['mj_sub_token']); - if (sha1(http_build_query($_GET) . self::WIDGET_HASH) !== $mj_sub_token) { - echo '

    '; - echo __('Error. Token verification failed.', 'wp-mailjet-subscription-widget'); - echo '

    '; - die; - } - - $email = $_GET['email']; - - $contacts[] = array( - 'Email' => $email - ); - - // Add the contact to the contact list - $result = $this->api->addContact(array( - 'action' => 'addforce', - 'ListID' => $_GET['list_id'], - 'contacts' => $contacts - )); - - $metaProperties = $this->getContactMetaProperties(false); - - $properties = array(); - if (is_object($metaProperties)) { - foreach ($metaProperties->Data as $i => $prop) { - if (!array_key_exists($prop->Name, $_GET)) { - continue; - } - $properties[] = array( - 'Name' => $prop->Name, - 'Value' => $_GET[$prop->Name] - ); - } - } - - if (is_object($result)) { - if (!empty($result->Data)) { - $result2 = $this->api->updateContactData(array( - 'method' => 'JSON', - 'ID' => $email, - 'Data' => $properties - )); - } - } - - - echo '

    '; - echo sprintf(__("Thanks for subscribing with %s", 'wp-mailjet-subscription-widget'), $email); - echo '

    '; - die(); - } - - function widget($args, $instance) - { - $this->getContactMetaProperties(false); - // enqueue the scripts required for the widget (only if the widget is active) - // scripts will appear in the footer which is good for speed - wp_enqueue_script('ajax-example', plugins_url('/assets/js/ajax.js', __FILE__), array('jquery')); - wp_localize_script('ajax-example', 'WPMailjet', array( - 'ajaxurl' => admin_url('admin-ajax.php'), - 'nonce' => wp_create_nonce('ajax-example-nonce'), - 'loadingImg' => plugin_dir_url(__FILE__) . 'assets/images/loading.gif' - )); - - // output the widget itself - extract($args, EXTR_SKIP); - - echo $before_widget; - - $langFields = array('enableTab', 'title', 'list_id', 'button_text', 'metaPropertyName1', 'metaPropertyName2', - 'metaPropertyName3', 'metaProperty1', 'metaProperty2', 'metaProperty3' - ); - if (isset($fields) && is_array($fields)) { - foreach ($fields as $prop) { - ${$prop} = empty($instance[$prop]) ? '' : $instance[$prop]; - } - } - - $locale = get_locale(); - if (in_array($locale, array('de_DE', 'de_DE_formal'))) { - $locale = 'de_DE'; - } - foreach ($this->langs as $lang => $langProps) { - if ($locale !== $langProps['locale']) { - continue; - } - $currentLang = $lang; - } - - // if the widget is not configured for the current WP language, the English widget configuration is taken - $currentLang = empty($currentLang) ? 'en' : $currentLang; - - foreach ($langFields as $prop) { - if (!empty($instance[$prop . $currentLang])) { - ${$prop . $currentLang} = $instance[$prop . $currentLang]; - } - } - - $title = apply_filters('widget_title', $instance['title' . $currentLang]); - $list_id = $instance['list_id' . $currentLang]; - $button_text = trim($instance['button_text' . $currentLang]); - - // If contact list is not selected then we just don't display the widget! - if (!is_numeric($list_id)) { - return FALSE; - } - - if (!empty($title)) { - echo $before_title . $title . $after_title; - }; - ?> - - - -
    - Add and send `mailjet-for-wordpress.zip`. -3. Activate the Mailjet extension through the 'Plugins' menu in WordPress. +2. Go to Plugins > Add New +3. Find "Mailjet Email Marketing" in the plugins directory and install it +- or - +Click "Upload plugin" and upload the `mailjet-for-wordpress.zip` file from GitHub +4. Activate the Mailjet extension through the "Plugins" menu in WordPress. -You must have cURL extension enabled. PHP 5.3 or later version is required. +You must have cURL extension enabled. PHP 5.6 or later version is required. ## Frequently Asked Questions = What is Mailjet? = -[Mailjet](http://www.mailjet.com?aff=wordpressmj) is an all-in-one solution to send, track and deliver both marketing and transactional emails. Its cloud-based infrastructure is unique and highly scalable with a proprietary technology that optimizes email deliverability. Mailjet can be accessed either via an easy-to-use online drag-and-drop interface or via APIs that allow developers to integrate its features within their online app or service, or its sophisticated SMTP relay. +[Mailjet](http://www.mailjet.com?aff=wordpressmj) is an all-in-one solution to send, track and deliver both marketing and transactional emails. Its cloud-based infrastructure is unique and highly scalable with a proprietary technology that optimizes email deliverability. Mailjet can be accessed either via an easy-to-use online drag-and-drop interface or via APIs that allow developers to integrate its features within their online app or service, or its sophisticated SMTP relay. -= Why use Mailjet on Wordpress? = -Because you don’t have time to build a global leading email infrastructure and have a product or service to build and grow += Why use Mailjet on WordPress? = +Because you don't have time to build a global leading email infrastructure and have a product or service to build and grow Because you want to compose responsive Newsletters that engage your users and boost your traffic or revenue without having to code Because you want the latest in email tracking technology that shows you which users open and click on your newsletters, when, on what device, on which links, etc. -Because you want to contact a Support Helpdesk that works when you do whether you’re a morning person or a night owl. +Because you want to contact a Support Helpdesk that works when you do whether you're a morning person or a night owl. Because you want to easily subscribe new users to your contact lists and not have to worry about keeping them in sync Because you want to make sure your emails get delivered to the inbox! @@ -68,299 +78,127 @@ Because you want to make sure your emails get delivered to the inbox! Yes. You can [create one for free](https://app.mailjet.com/signup?aff=wordpressmj): it's easy and it only takes a few minutes. = How to get started with this plugin? = -Once you have a Mailjet account, an installation Wizard will guide you through. You want to use Mailjet as an SMTP relay, so you will need to change these parameters in your Wordpress email configuration: username and password. These credentials are provided in your 'My Account > API Keys' section [HERE](https://app.mailjet.com/account/api_keys). -For more help on setting up the Mailjet Plugin for WordPress, feel free to check out our [dedicated WordPress User Guide](https://www.mailjet.com/guides/wordpress-user-guide?aff=wordpressmj). +Once you have a Mailjet account, an installation Wizard will guide you through. +In case you want to use Mailjet as an SMTP relay you will need to change these parameters in your WordPress email configuration: username and password. These credentials are provided in your Mailjet Account > API Keys section [HERE](https://app.mailjet.com/account/api_keys). +For more help on setting up the Mailjet Plugin for WordPress, feel free to check out our [dedicated WordPress User Guide](https://www.mailjet.com/guides/wordpress-user-guide?aff=wordpressmj). = How do I create a signup form or use the contact widget? = -Once your Mailjet plugin is installed, click on "Appearance" in the left-side menu and then choose the "Widgets" section. Just drag the "Subscribe to Our Newsletter" widget and drop it where you want it to appear (i.e. the sidebar). For more precisions, please visit the official help page [Adding Widgets](http://en.support.wordpress.com/widgets/#adding-widgets). +Once your Mailjet plugin is installed and configured, click on "Appearance" in the left-side WordPress admin menu and then choose the "Widgets" section. Just drag the "Mailjet Subscription Widget" widget and drop it where you want it to appear (i.e. the sidebar). For more details, please visit the official help page [Adding Widgets](http://en.support.wordpress.com/widgets/#adding-widgets). -= How do I synchronize my contact lists? = -Synchronization is automatic, that's the beauty of this plugin! It doesn't matter whether your lists were uploaded on your WordPress interface or on your Mailjet account: they will always remain up-to-date on both sides. += How do I synchronize my contact lists? = +Synchronization is automatic, that's the beauty of this plugin! It doesn't matter whether your lists were updated on your WordPress interface or on your Mailjet account: they will always remain up-to-date on both sides. = In which languages is this plugin available? = -The Mailjet Plugin is available in English, Spanish, French and German. -Need help? Our multilingual support team is here to answer your questions in any of these languages, any day of the week, at any time via our [online helpdesk](https://www.mailjet.com/support). +The Mailjet Plugin is available in English, Spanish, French, German and Italian. +Need help? Our multilingual support team is here to answer your questions in any of these languages, any day of the week, at any time via our [online helpdesk](https://app.mailjet.com/support). + += How to use filters to customize the subscription confirmation email template = +Add the following code to your template functions.php file. Uncomment the messages that you would like to replace. +
    
    +/**
    + * Override subscription confirmation email texts
    + * @param array $emailData -default Mailjet email template parameters
    + * @return string
    + */
    +
    +function updateMailjetSubscriptionEmailParameters($emailData) {
    +add_filter( 'mailjet_subscription_widget_email_params', 'updateMailjetSubscriptionEmailParameters' );
    +
    +    // Some custom parameters used from custom template added via `mailjet_confirmation_email_filename`
    +    // $emailData['TITLE'] = 'Custom title';
    +    // $emailData['SOME_HEADER'] = 'Custom header';
    +    // $emailData['CONFIRM'] = 'Custom confirm';
    +    // $emailData['SOME_FOOTER'] = 'Custom footer';
    +
    +    // Override default mailjet parameters
    +    // $emailData['__EMAIL_TITLE__'] = 'Please confirm your subscription';
    +    // $emailData['__EMAIL_HEADER__'] = 'To receive newsletters from __WP_URL__ please confirm your subscription by clicking the following button:';
    +    // $emailData['__CLICK_HERE__'] = 'Yes, subscribe me to this list';
    +    // $emailData['__COPY_PASTE_LINK__'] = 'You may copy/paste this link into your browser:';
    +    // $emailData['__IGNORE__'] = 'If you received this email by mistake or don\'t wish to subscribe anymore, simply ignore this message.';
    +    // $emailData['__THANKS__'] = 'Thanks,';
    +    // $emailData['__FROM_NAME__'] = 'The Mailjet Team';
    +    return $emailData;
    +}
    +
    + += How to use filters to replace the email confirmation template with my own file = +You need to have a php file with your custom template uploaded to your WordPress server. Then add the following code to your template functions.php file. +
    
    +/**
    + * Replace default Mailjet template path with a your own
    + * @param string $templatePath - the path of the default mailjet template
    + * @return string
    + */
    +
    +add_filter( 'mailjet_confirmation_email_filename', 'useCustomConfirmationEmail' );
    +function useCustomConfirmationEmail($templatePath) {
    +    return './custom_subscription_path.php';
    +}
    +
    + += How to use filters to set your own Thank You page = +You need to have a php file with your custom template uploaded to your WordPress server. Then add the following code to your template functions.php file. +
    
    +/**
    + * Replace default Mailjet Thank You page template path with a your own
    + * @param string $templatePath - the path of the default Mailjet Thank You page template
    + * @return string
    + */
    +
    +add_filter( 'mailjet_thank_you_page_template', 'updateThankYouPagePath' );
    +function updateThankYouPagePath($templatePath) {
    +    return './custom_thank_you_page_path.php';
    +}
    +
    + += How to use filters to replace the widget form file = +You need to have a php file with your custom template uploaded to your WordPress server. Then add the following code to your template functions.php file. +
    
    +/**
    + * Replace default Mailjet widget form file with your own
    + * @param string $templatePath - the path of the default Mailjet widget form file
    + * @return string
    + */
    +
    +add_filter( 'mailjet_widget_form_filename', 'useMailjetCustomWidgetFormTemplate' );
    +function useMailjetCustomWidgetFormTemplate($templatePath) {
    +    return './custom_mailjet_widget_template.php';
    +}
    +
    + += For developers - before pushing any new changes, make sure you run the following command. It will remove unneeded .git direcotries from vendors = +
    
    +find vendor/ -type d -name ".git" -exec rm -rf {} \;
    +
    == Screenshots == -1. Simply change a few parameters to get started. -2. Manage your lists and contacts in no time! +1. The initial setup wizard will guide you through the quick steps to get started +2. Access all features from the plugin dashboard 3. Create and send beautiful email campaigns -4. Get instant insight on your campaign's performance with detailed statistics +4. Configure a subscription widget to collect subscribers from your site == Changelog == -= 4.3.0 = -* Update the confirmation email template for English, French, German and Spanish -* Add new filter 'mailjet_subscription_widget_email_params' that enable the users to replace the email confirmation message parameters -* Add new filter 'mailjet_confirmation_email_filename' that enable the users to replace the email confirmation template -* Add new field 'From name' in Mailjet General Settings -* Add event delegation that allow widget to work if it is loaded via AJAX - -= 4.2.16 = -* Update the confirmation email template -* Add new filter 'mailjet_subscription_widget_email_params' that enable the users to replace the email confirmation message parameters -* Add new filter 'mailjet_confirmation_email_filename' that enable the users to replace the email confirmation template -* Add new field 'From name' in Mailjet General Settings -* Add event delegation that allow widget to work if it is loaded via AJAX - -= 4.2.15 = -* Remove changing plugins locale globally - -= 4.2.14 = -* Update tracking parameter - -= 4.2.13 = -* Added support for de_DE_formal locale - -= 4.2.12 = -* Translation update - -= 4.2.11 = -* Updated 'Tested up to' version to include WordPress 4.9 - -= 4.2.10 = -* Translations update - -= 4.2.9 = -* Fix strtotime() function when format is dd/mm/YYYY - -= 4.2.8 = -* Added conversion to timestamp for date time contact properties before send them to the API - -= 4.2.7 = -* Subscription widget added validation for contact properties of date type - -= 4.2.6 = -* Added new translations - -= 4.2.5 = -* Replace site_url with home_url for subscription confirmation links - -= 4.2.4 = -* Fix widget subscription issue - -= 4.2.3 = -* Replace short array definition usage with long one for backward compatibility - -= 4.2.2 = -* Rename some function to avoid conflict with 3rd party ones - -= 4.2.1 = -* Updated widget connection over SSL - -= 4.2.0 = -* Added Initial Wordpress user synchronization to Mailjet -* Added Wordpress user role as a contact property and synced to Mailjet -* Changes on Mailjet plugin configuration page - -= 4.1.19 = -* Updated text description, icon, screenshots and style - -= 4.1.18 = -* Updated text description, icon, screenshots and style - -= 4.1.17 = -* Updated Readme file - -= 4.1.16 = -* Updated Readme file - -= 4.1.15 = -* Updated screenshots -* Updated header image -* Updated Readme file - -= 4.1.14 = -* Widget - disabled rewrite of subscription confirmation link - -= 4.1.13 = -* Slight visual modifications - changed iframe left margin and width - -= 4.1.12 = -* Updated 'Tested up to' version to include WordPress 4.7 - -= 4.1.11 = -* Updating widget CSS for better displaying on lower resolutions - -= 4.1.10 = -* Add the link to the user guide & Support Ticket -* UX change in settings page - -= 4.1.9 = -* Widget - css fix - -= 4.1.8 = -* Improvement in Subscription widget - Adding an additional link - -= 4.1.7 = -* Fix with additional fields on registration form - -= 4.1.6 = -* System message update - -= 4.1.5 = -* API call improvements - -= 4.1.4 = -* Replaced jQuery .live() with .on() -* CSS conflict with a specific 3rd party plugin fix -* auto-subscribe improvement -* Updated 'Tested up to' version to include WordPress 4.4.1 - -= 4.1.3 = -* Widget - meta property fix -* Widget - on subscription, the code will check for valid input data types -* Widget - the input contact meta properties now appear correctly in the front end when the site is in language other than the 4 languages supported (EN, FR, DE, ES) - -= 4.1.2 = -* Translations fixes -* Subscribe to contacts list with different scenarios - fix - -= 4.1.1 = -* JavaScript fixes of the widget -* CSS fixes for jquery accordion ui plugin - -= 4.1.0 = -* Subscription widget - added multilanguage support - EN, FR, ES, DE -* Display issue fix - -= 4.0.1 = -* Updated 'Tested up to' version to include WordPress 4.4 - -= 4.0.0 = -* Subscription widget for v3 users can now include contact meta properties from the client e.g. first name, last name, age, location, industry etc, allowing up to 3 properties. - -= 3.2.4 = -* Fixed sign up link translations - -= 3.2.2 = -* Added new iFrame param - sp=display - to display sending policy block - -= 3.2.1 = -* Removed Reply-To header when using PHPMailer - -= 3.1.21 = -* Readme file update - -= 3.1.20 = -* Added USER AGENT tracking on every curl request - -= 3.1.19 = -* Widget button translation fix - -= 3.1.18 = -* Servers with PHP version 5.3 would be able to check if headers for ReplyTo already exist and add the Mailjet headers only if no ReplyTo headers are set. - -= 3.1.17= -* When we create a TOKEN we also send SentData containing plugin name - -= 3.1.16= -* Translation of the iframe and also some small corrections are executed for the translations from i18n folder; - -= 3.1.15= -* All strings are translated in german, french and spanish. - -= 3.1.14= -* Changed checking for correct sender. - -= 3.1.13= -* Modification of how to detect v1 and v3 users. - -= 3.1.12= -* Part of the translations are translated. - -= 3.1.11= -* We display more human readable messages for those cases when we enter wrong API/Secret Key and also our "from email" does not match with any of the sender part of our Mailjet's account - -= 3.1.10= -* Rename function my_save_extra_profile_fields to mailjet_my_save_extra_profile_fields - -= 3.1.9= -* Bug fix related to the compatibility of the plugin for v1 and v3 users - -= 3.1.8= -* Stop scripts from being output unnecessarily when we load the widget on the front-end. - -= 3.1.7= -* The user can set the port from the settings page. - -= 3.1.6= -* The administrator of the website is able to give access to the plugin for other user roles. - -= 3.1.5= -* MJ_HOST and MJ_MAILER variables are moved to the api strategy patter class as public properties of the class. From now on, they are -accessible from there. - -= 3.1.4= -* Add a confirmation message when an user activates his/her contact widget on his/her Wordpress admin -* In the admin panel of WordPress, when a user try to add a "subscribe to our newsletter widget" we have add a validation if he/she has chosen a contact list - -= 3.1.3= -* The position of the main Mailjet's menu takes a default value instead of value 101 -* Removed AKID from APIv3 calls from the plugin -* Prevent plugin from hiding other plugin's page #10 -* README update - -= 3.1.2 = -* Updated readme - -= 3.1.1 = -* Tag bug fix for V1 & V3 compatible plugin - -= 3.1.0 = -* Supports V1 and V3 Mailjet's users, Add use tracking on the WordPress plugin, Fix IsActive parameter for token creation - -= 3.0.3 = -* Add tracking of signups on the WordPress plugin, Fix IsActive parameter for token creation - -= 3.0.2 = -* Fix MailJet host - -= 3.0.1 = -* Bug fix on connecting contact to a list - -= 3.0.0 = -* The plugin is switched to v3 mailjet's users, and also the communication with mailjet is mainly executed with iframes - -= 1.2.8 = -* Added cURL warning and missing translations - -= 1.2.7 = -* Bug fix on ssl option and widget constructor, code cleaning - -= 1.2.6 = -* Bug fix - -= 1.2.5 = -* Add ability to autosubscribe newly registered users to a specific list - -= 1.2.3 = -* Add ports 80 and 588 to work around some hosts limitations - -= 1.2.2 = -* Added Ability to change widget button text - -= 1.2.1 = -* Added campaigns and statistics management += 5.0.6 = +* Allow logged in WooCommerce customers to subscribe to the newsletter during checkout. +* Fixed css issues in the WP admin +* Small bugfixes and improvements -= 1.1.5 = -* Added: HTTP Port Configuration += 5.0.5 = +* Fix subscription widget issues for multilanguage sites +* Fix fatal error for WooCommerce integration -= 1.1.3 = -* Bugfix: Correct ajax request for WordPress 3.2.1 -* Bugfix: Correct widget creation += 5.0.4 = +* Fix widget contact properties to be compatible with polylang -= 1.1.1 = -* added readme and translations files += 5.0.3 = +* Fix fatal error for php 5.5 -= 1.1 = -* Bug fix: compatibility with WordPress 3.4 -* Add support for list edition and creation -* Add signup form to list in native WordPress widget += 5.0.2 = +* Fix small bugfixes -= 1.0.1 = -* Bug fix on install. += 5.0.1 = +* Plugin redesign and major improvements -= 1.0= -* First stable release. diff --git a/screenshot-1.png b/screenshot-1.png index f2f9a2ca..6a874d25 100644 Binary files a/screenshot-1.png and b/screenshot-1.png differ diff --git a/screenshot-2.png b/screenshot-2.png index 616deed5..9eda2c1a 100644 Binary files a/screenshot-2.png and b/screenshot-2.png differ diff --git a/screenshot-3.png b/screenshot-3.png index dcb50eaa..ec4b972d 100644 Binary files a/screenshot-3.png and b/screenshot-3.png differ diff --git a/screenshot-4.png b/screenshot-4.png index 8dfa0393..54c9b77d 100644 Binary files a/screenshot-4.png and b/screenshot-4.png differ diff --git a/src/admin/MailjetAdmin.php b/src/admin/MailjetAdmin.php new file mode 100644 index 00000000..632c4b93 --- /dev/null +++ b/src/admin/MailjetAdmin.php @@ -0,0 +1,93 @@ + + */ +class MailjetAdmin +{ + /** + * The ID of this plugin. + * + * @since 5.0.0 + * @access private + * @var string $plugin_name The ID of this plugin. + */ + private $plugin_name; + + /** + * The version of this plugin. + * + * @since 5.0.0 + * @access private + * @var string $version The current version of this plugin. + */ + private $version; + + /** + * Initialize the class and set its properties. + * + * @since 5.0.0 + * @param string $plugin_name The name of this plugin. + * @param string $version The version of this plugin. + */ + public function __construct( $plugin_name, $version ) + { + $this->plugin_name = $plugin_name; + $this->version = $version; + } + + /** + * Register the stylesheets for the admin area. + * + * @since 5.0.0 + */ + public function enqueue_styles() + { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Plugin_Name_Loader as all of the hooks are defined + * in that particular class. + * + * The Plugin_Name_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + + wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mailjet-admin.css', array(), $this->version, 'all' ); + + } + + /** + * Register the JavaScript for the admin area. + * + * @since 5.0.0 + */ + public function enqueue_scripts() + { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Plugin_Name_Loader as all of the hooks are defined + * in that particular class. + * + * The Plugin_Name_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + + wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mailjet-admin.js', array( 'jquery' ), $this->version, false ); +// wp_enqueue_script('admin_js_bootstrap_hack', plugins_url('js/bootstrap-hack.js', __FILE__), false, '1.0.0', false); + } +} diff --git a/src/admin/css/mailjet-admin.css b/src/admin/css/mailjet-admin.css new file mode 100644 index 00000000..e5023d32 --- /dev/null +++ b/src/admin/css/mailjet-admin.css @@ -0,0 +1,932 @@ +@import url('https://fonts.googleapis.com/css?family=Roboto:400,500'); + +/** + * Global styles and WP/bootsrap override + */ +.mj-pluginPage { + font-family: Roboto; + font-size: 14px; + color: #555; + margin-right: 20px; +} +.mj-pluginPage h1, +.mj-pluginPage h2, +.mj-pluginPage h3, +.mj-pluginPage h4, +.mj-pluginPage h5, +.mj-pluginPage h6 { + font-weight: 500; + color: inherit; +} +.mj-pluginPage a { + text-decoration: none; + color: #19BC9C; +} +.mj-pluginPage a:hover, +.mj-pluginPage a:focus { + text-decoration: underline; + color: #33D6B6; +} +.mj-pluginPage a:focus { + outline: 0; + box-shadow: none; +} +.mj-pluginPage a:visited { + /* text-decoration: underline; + color: #9B59B6;*/ +} +.mj-pluginPage b { + font-weight: 500; +} +.mj-pluginPage p { + max-width: 550px; + line-height: 20px; + margin-top: 0; + margin-bottom: 24px; + font-size: 14px; +} + +#initialSettingsForm #mailjet_apikey{ + width: 100%!important; + max-width: none; +} + +#initialSettingsForm #mailjet_apisecret{ + width: 100%!important; + max-width: none; +} + +.mj-pluginPage input[type="text"] { + /*width: 100%;*/ + max-width: 311px; + height: 36px; + margin-bottom: 16px; + padding-left: 16px; + padding-right: 16px; + border: 1px solid #888; + border-radius: 3px; + font-family: Roboto; + font-size: 14px; + color: #555; + background-color: #fff; + box-shadow: none; +} +.mj-pluginPage input[type="text"]:hover { + border-color: #555; +} +.mj-pluginPage input[type="text"]:focus { + border-color: #19BC9C; +} +::-webkit-input-placeholder { + font-family: Roboto; + color: #a2a2a2; +} +::-moz-placeholder{ + font-family: Roboto; + color: #a2a2a2; + opacity: 1; +} +:-ms-input-placeholder { + font-family: Roboto; + color: #a2a2a2; +} +::placeholder { + font-family: Roboto; + color: #a2a2a2; +} +:focus::-webkit-input-placeholder { + color: #555; +} +:focus::-moz-placeholder { + color: #555; + opacity: 1; +} +:focus:-ms-input-placeholder { + color: #555; +} +:focus::placeholder { + color: #555; +} +.mj-show { + min-height: 0; + overflow: hidden; + transition: height 0ms ease-in 0ms, min-height 250ms ease-in 0ms; +} +.mj-hide { + height: 0; + overflow: hidden; + transition: height 75ms ease-in 0ms, min-height 75ms ease-in 0ms; +} +.mj-disabled { + opacity: .4; + cursor: not-allowed; +} +.mj-pluginPage .form-table { + margin-top: 0; +} +.mj-pluginPage .form-table td { + padding: 0; +} +.mj-pluginPage .form-table td p { + margin-top: 0; +} +.mj-pluginPage .mj-label, +.mj-pluginPage .form-table td fieldset .label { + display: block; + max-width: -moz-max-content; + max-width: max-content; + line-height: 20px; + margin: 0 0 8px !important; + cursor: inherit; +} +.mj-select-wrapper { + position: relative; + display: inline-block; + margin-bottom: 16px; +} +.mj-select-wrapper:before { + content: attr(data-value); + position: absolute; + left: 0; + top: 0; + z-index: 1; + display: block; + width: 100%; + height: 100%; + line-height: 20px; + padding: 8px 32px 8px 16px; + border: 1px solid #888; + border-radius: 3px; + font-weight: 500; + color: #555; + background-color: #fff; + outline: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.mj-select-wrapper:after { + content: ''; + position: absolute; + right: 16px; + top: calc(100% / 2); + z-index: 2; + display: block; + width: 0; + height: 0; + border-style: solid solid none solid; + border-width: 5px 4px 0 4px; + border-color: #555 transparent transparent transparent; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.mj-select-wrapper:hover:before { + border-color: #555; +} +.mj-select-wrapper.mj-select-focus:before { + border-color: #19BC9C; +} +.mj-select-wrapper select { + position: relative; + z-index: 3; + width: 312px; + height: 36px; + opacity: 0; +} + +/** +* Buttons + No choice but to override styles of buttons created with submit_button function ("button" class), + having styles in load-styles.php (loaded after mailjet-admin.css) +*/ +.mj-pluginPage .mj-btn, +.mj-pluginPage .mj-btn.button { + min-width: 84px; + height: 36px; + line-height: 20px; + padding: 8px 16px; + border: 1px solid currentColor; + border-radius: 3px; + text-align: center; + font-size: 14px; + font-weight: 500; + background-color: transparent; + box-shadow: none; + cursor: pointer; +} +.mj-pluginPage .mj-btn:hover, +.mj-pluginPage .mj-btn:focus, +.mj-pluginPage .mj-btn:active, +.mj-pluginPage .mj-btn.button:hover, +.mj-pluginPage .mj-btn.button:focus, +.mj-pluginPage .mj-btn.button:active { + transform: none; + outline: 0; + box-shadow: none; +} +.mj-pluginPage .btnPrimary, +.mj-pluginPage .btnPrimary:hover, +.mj-pluginPage .button.btnPrimary, +.mj-pluginPage .button.btnPrimary:hover { + border-color: transparent; + color: white; + background-color: #FEAD0D; +} +.mj-pluginPage .btnPrimary:hover, +.mj-pluginPage .button.btnPrimary:hover { + background-color: #FFBA1A; +} +.mj-pluginPage .btnPrimary:focus, +.mj-pluginPage .btnPrimary:active, +.mj-pluginPage .button.btnPrimary:focus, +.mj-pluginPage .button.btnPrimary:active { + background-color: #F1A000; +} +.mj-pluginPage .btnSecondary, +.mj-pluginPage .button.btnSecondary { + color: #FEAD0D; + border-color: currentColor; +} +.mj-pluginPage .btnSecondary:hover, .btnSecondary:active, .btnSecondary:focus, +.mj-pluginPage .button.btnSecondary:hover, .button.btnSecondary:active, .button.btnSecondary:focus { + background-color: rgba(254,173,13,0.1); +} +.mj-pluginPage .btnCancel, +.mj-pluginPage .button.btnCancel { + border-color: transparent; + color: #888; +} + +.mj-pluginPage .btnCancel:active, .mj-pluginPage .btnCancel:focus, +.mj-pluginPage .button.btnCancel:active, .button.mj-pluginPage .button.btnCancel:focus { + color: #555; + background-color: #e5e5e5; +} +.mj-pluginPage .btnSmall { + min-width: 0; + height: 28px; + padding: 4px 16px; +} +.mj-btn + .mj-btn { + margin-left: 16px; +} +.btnSmall + .btnSmall { + margin-left: 8px; +} + +/** +* Don't break notices +*/ +.mj-pluginPage .notice { + margin: 16px 0 16px 0; +} +.mj-pluginPage .notice p { + margin: .5em 0; +} +.mj-pluginPage .notice strong { + font-weight: 500; +} + +/** +* Override bootstrap modal styles +*/ +.mj-pluginPage .modal-backdrop { + background-color: #2D2F37; +} +.mj-pluginPage .modal-backdrop.in { + opacity: .6; +} +.mj-pluginPage .modal.in .modal-dialog { + transform: translate(0, calc(50vh - 50%)); + margin-top: 0; +} +.mj-pluginPage .modal-content { + overflow: hidden; + border-radius: 3px; + box-shadow: 0 1px 20px 0 rgba(0, 0, 0, .2); +} +.mj-pluginPage .modal-header { + display: flex; + padding: 12px 32px 15px; + border-top: 4px solid #FEAD0D; + border-bottom: 1px solid #e5e5e5 !important; +} +.mj-pluginPage .modal-title { + flex-grow: 1; + line-height: 32px; + font-size: 20px; + font-weight: 500; +} +.mj-pluginPage .button.close { + font-size: 0; + color: rgba(255, 255, 255, 0); +} +.mj-pluginPage .modal-body { + padding: 32px; +} +.mj-pluginPage .modal-body input { + margin-bottom: 0; +} +.mj-pluginPage .modal-footer { + padding: 16px 32px; +} +/** + * All of the CSS for your admin-specific functionality should be + * included in this file. + */ +.admin_page_mailjet_allsetup_page #wpwrap, +.admin_page_mailjet_user_access_page #wpwrap, +.admin_page_mailjet_subscription_options_page #wpwrap, +.admin_page_mailjet_sending_settings_page #wpwrap, +.admin_page_mailjet_connect_account_page #wpwrap, +.admin_page_mailjet_settings_page #wpwrap, +.admin_page_mailjet_initial_contact_lists_page #wpwrap, +.admin_page_mailjet_dashboard_page #wpwrap, +.toplevel_page_mailjet_settings_page #wpwrap { + background-color: #F2F2F2; +} +/* Error messages */ +#setting-error-mailjet_message { + margin-left: 0px; +} +/*.button.MailjetSubmit, .button.MailjetSubmit:hover, .button.MailjetSubmit:focus { + border-color: transparent; +}*/ +/** STYLE 11 */ + +#availableContactListsContainerParent::-webkit-scrollbar { + width:10px; +} +#availableContactListsContainerParent::-webkit-scrollbar-track { + border-radius: 10px; + background: rgba(0,0,0,0.1); + border: 1px solid #ccc; +} +#availableContactListsContainerParent::-webkit-scrollbar-thumb { + border-radius: 10px; + background: linear-gradient(to left, #fff, #e4e4e4); + border: 1px solid #aaa; +} +#availableContactListsContainerParent::-webkit-scrollbar-thumb:hover { + background: #fff; +} + +#availableContactListsContainerParent::-webkit-scrollbar-thumb:active { + background: linear-gradient(to left, #22ADD4, #1E98BA); +} +.mj-pluginPage .checkboxLabel, +.mj-pluginPage .form-table td fieldset .checkboxLabel { + display: flex; + max-width: -moz-max-content; + max-width: max-content; + line-height: 20px; + margin: 0 0 8px !important; +} +.mailjet_row input[type="checkbox"] { + content: "\00a0"; + position: relative; + top: 1px; + display: inline-block; + font: 16px/1em sans-serif; + margin: 0 8px 0 0; + padding: 0; + height: 16px; + width: 16px; + /*border: 1px solid #19BC9C;*/ + border: 1px solid #888888; + border-radius: 3px; + box-shadow: none; +} +.mailjet_row input[type="checkbox"]:checked::before { + margin: -1px 0 0 -2px; + font-size: 16px; +} +.mailjet_row input[type="checkbox"]:focus { + border:1px solid #19BC9C; + background: #FFFFFF; + outline:none; +} +.mailjet_row input[type="checkbox"]:checked { + border: 1px solid #19BC9C; + background: #33D6B6; + content: "\2714"; + color: #FFF; + text-align: center; + font-weight: bold; +} +.mailjet_row input[type="checkbox"]:checked:before { + color: #FFF; +} +/*#wpbody-content { + padding-right: 20px; +}*/ +.mainContainer { + border-radius: 3px; + background-color: #FFFFFF; + box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2); + padding: 16px 0 20px 32px; +} +.backToDashboard { + /*margin-bottom: 24px;*/ +} +.backToDashboard a { + display: inline-flex; + align-items: center; +} +.backToDashboard a, +.backToDashboard a:hover, +.backToDashboard a:focus, +.backToDashboard a:active, +.backToDashboard a:visited { + text-decoration: none; + color: #888; +} +.backToDashboard svg { + width: 8px; + height: 8px; + margin-right: 8px; + fill: currentColor; +} +.mailjet_row label { + font-weight: normal; + font-size: 14px; + line-height: 20px; +} +.initialSettings { + display: flex; +} +#initialSettingsForm { + width: 359px; + border: 1px solid #E5E5E5; + border-radius: 3px; + padding: 24px; +} +#initialSettingsForm .form-table { + margin-bottom: 8px; +} +#initialSettingsSubmit { + display: block; + width: 100%; +} +#initialSettingsForm .dont_have_account { + margin: 24px 0 0; +} +.closeCreateList, +#subscriptionOptionsSubmit { + float: left; + margin-left:10px; +} +#initialSettingsHead { + /*height: 48px;*/ + border-radius: 3px 3px 0 0; + background-color: #23282D; + margin-top:20px; + left:0; + /*padding:10px;*/ + padding:4px; + padding-top:13px; +} +#initialSettingsDescription { + width: 550px; + margin-left: 50px; +} + +.initialSettingsDescriptionContainer { + display: table; +} +.initialSettingsDescriptionRow { + display: flex; + max-width: 526px; + align-items: center; + margin-bottom: 16px; +} +.initialSettingsDescriptionRow .initialSettingsTextCell { + margin-bottom: 0; +} +.initialSettingsImageCell { + width: 96px; + height: 96px; + margin-right: 30px; +} +.initialSettingsTextCell b { + display: block; + margin-bottom: 8px; + font-size: 16px; +} +.mjSettings { + min-height: 450px; + display: flex; + align-items: stretch; +} +.mjSettings .left { + /* width: 268px; */ + padding-right: 16px; + border-right: 1px solid #e5e5e5; +} +.mjSettings .left .centered h1 { + font-size: 32px; + font-weight: 500; + line-height: 40px; +} +.mjSettings .right { + max-width: 600px; + padding: 16px 32px; +} +.mjSettings .mailjet_sync_options_div { + margin-bottom: 24px; +} +.mjSettings .settingsSubscrFldset { + margin-bottom: 24px; +} +.mjSettings .settingsAccessFldset { + margin-bottom: 16px; +} +.mjSettings .settingsConnectFldset { + margin-bottom: 8px; +} +.mjSettings .settingsSendingFldset { + margin-bottom: 16px; + padding-left: 24px; +} +.mjSettings .settingsSendingFldset .fromFld, +.mjSettings .settingsSendingFldset .smtpFld { + margin-bottom: 8px; +} +.mjSettings .settingsSendingFldset .smtpFld .mj-select-wrapper { + margin-bottom: 0; +} +.mjSettings .settingsSendingFldset .smtpFld select { + width: auto; + min-width: 80px; +} +.mjSettings .fromFldGroup { + display: flex; +} +.mjSettings .fromFldGroup input[type="text"] { + margin-right: 16px; +} +.mjSettings .testEmailFldset { + margin-bottom: 24px; +} +.mjSettings .sendTestEmailBtn { + display: block; + padding: 0; + margin: 0; + border: none; + color: #19BC9C; + background: transparent; + outline: 0; + cursor: pointer; +} +.mjSettings .sendTestEmailBtn:before { + content: ''; + display: inline-block; + width: 6px; + height: 6px; + margin-right: 8px; + border-top: 1px solid currentColor; + border-right: 1px solid currentColor; + transform: rotate(45deg); + transform-origin: center; + vertical-align: 2px; + transition: transform .075s ease-in; +} +.mjSettings .sendTestEmailBtn.mj-active:before { + transform: rotate(-45deg) translateY(1px); + transition: transform .25s ease-in; +} +.mjSettings .test_email_collapsible { + overflow: hidden; +} +.mjSettings .test_email_collapsible label { + margin-top: 16px !important; +} +.mjSettings .test_email_collapsible .test_email_fields_group { + display: flex; +} +.mjSettings .test_email_collapsible input { + margin: 0 8px 0 0; +} + +.mjSettings .mailjet_sync_comment_authors_div .mj-select-wrapper { + margin-bottom: 0; +} +/*May should remove 1,2,3,4,5*/ +.bottom_links { + display: flex; + max-width: -moz-max-content; + max-width: max-content; + line-height: 20px; + margin-top: 24px; +} +.bottom_links > * { + margin-right: 24px; +} +.needHelpDiv { + display: flex; + align-items: center; + font-weight: 500; +} +.needHelpDiv img { + margin-right: 8px; +} +.bottom_links a:visited { + /*color: inherit;*/ +} +.bottom_links a:hover, +.bottom_links a:focus { + color: #33D6B6; +} +.settingsMenuLink a { + display: flex; + align-items: center; + height: 40px; + line-height: 24px; + /*padding: 8px;*/ + font-size: 16px; + font-weight: 500; + color: #555; +} +.settingsMenuLink a svg { + margin-right: 16px; + fill: currentColor; +} +.settingsMenuLink a:hover, +.settingsMenuLink a:active, +.settingsMenuLink a:focus { + text-decoration: none; + color: #555; + outline: 0; +} + +.settingsMenuLink a:not(.active):hover, +.settingsMenuLink a:not(.active):active { + background-color: #f2f2f2; +} +.settingsMenuLink a:not(.active):focus { + background-color: #e5e5e5; +} +.settingsMenuLink a:visited { + color: #555; +} +.settingsMenuLink a.active { + color: #19BC9C; +} +#mailjet_subscription_options_settings { + margin-bottom: 16px; +} + +/* Contacts list display screen */ +.availableContactLists { + margin-bottom: 24px; +} +.availableContactListsContainerParent { + width: 615px; + max-height: 476px; + overflow: auto; + margin-bottom: 24px; + border: 1px solid #E5E5E5; + border-radius: 3px; +} +.availableContactListsRow { + display: flex; + padding: 16px 24px; +} +.availableContactListsRow:not(:last-child) { + border-bottom: 1px solid #E5E5E5; +} +.availableContactListsCountCell { + width: 200px; +} +.availableContactListsNameCell { + flex-grow: 1; +} + +/* Create new Contact List popup */ +.create_contact_list_popup { + margin-bottom: 24px; +} +.create_contact_list_popup label { /* -2,3,4*/ + display: block; + max-width: max-content; + line-height: 20px; + margin: 0 0 8px !important; +} +#create_contact_list { + display: flex; + align-items: center; + line-height: 20px; + text-decoration: none; + color: #19BC9C; + cursor: pointer; +} +#create_contact_list.mj-active { + display: none; +} +#create_contact_list img { + height: 16px; + margin-right: 8px; +} +#create_contact_list:hover { + text-decoration: none; +} +.create_contact_list_fields { + margin-bottom: 8px; +} +.create_contact_list_btns { + display: flex; +} +.greenLink { + color: #19BC9C; + text-decoration: none; +} +.greenLink:hover { + text-decoration: none; +} + +.allsetupGreenLinkDiv { + margin-top: 24px; + /*padding-bottom: 20px;*/ + text-align: center; +} +#initialContactListsForm .initialContactListsFieldset p { + margin-bottom: 16px; +} + +/* Dashboard */ +.dashboard .initialSettingsMainCtn { + display: flex; + margin-top: 24px; + padding: 20px; +} +.dashboard .block { + position: relative; + padding: 24px; + border: 1px solid #E5E5E5; + border-radius: 3px; +} +.dashboard .leftCol { + flex-grow: 1; + display: flex; + flex-direction: column; + align-items: flex-start; + min-width: 40%; +} +.dashboard .passportImage { + flex-grow: 1; + width: 100%; + margin-top: 40px; + background-repeat: no-repeat; + background-size: contain; +} +.dashboard .rightCol { + display: flex; + flex-flow: row wrap; + min-width: 500px; + max-width: 650px; +} +.dashboard .rightCol .block { + display: flex; + flex-direction: column; + width: calc(40% - 16px); + margin: 0 0 16px 16px; + text-align: center; +} +.dashboard .rightCol .block:nth-last-child(-n+2) { + margin-bottom: 0; +} +.dashboard .rightCol .blockTitle { + line-height: 24px; + margin: 0 0 16px; + font-size: 16px; +} +.dashboard .rightCol .blockText { + flex-grow: 1; + margin-top: 0; +} +.dashboard .rightCol img { + width: 96px; + height: 96px; + margin: 0 auto 24px; +} +.dashboard .rightCol .mj-btn { + width: 100%; +} + +.allsetup_blocks { + display: flex; +} +.allsetup .block_single { + flex-grow: 1; + flex-basis: 0; + display: flex; + flex-direction: column; + padding: 24px; + border: 1px solid #E5E5E5; + border-radius: 3px; + text-align: center; +} +.allsetup .block_single + .block_single { + margin-left: 24px; +} +.allsetup .block_single img { + display: block; + width: 96px; + height: 96px; + margin: 0 auto 24px; +} +.allsetup .block_single .section_inner_title { + margin-bottom: 16px; +} +.allsetup .block_single .blockText { + flex-grow: 1; +} +.allsetup .block_single .mj-btn { + display: block; + width: 100%; +} +.cancelBtn { + background-color: #c5c5c5; + width: 100px; + height: 36px; + border: 1px solid #c1c1c1; + border-radius: 3px; + color: #FFF; + font-size: 14px; + font-weight: 500; + line-height: 20px; + text-align: center; + margin-left:10px; + color: #FCB340; +} + +.activate_mailjet_sync_field { + margin-bottom: 24px; +} +.mailjet_sync_options_div { + margin: 16px 0 0 18px; +} +.mailjet_sync_comment_authors_div{ + margin-left: 20px; +} + +.mainContainer .page_top_title { + line-height: 40px; + /*margin: 0 0 16px;*/ + margin: 0 0 0; + font-weight: 500; + font-size: 32px; +} +.mainContainer .page_top_subtitle { + line-height: 24px; + font-size: 16px; +} +.mainContainer .section_title { + font-weight: 500; + font-size: 16px; +} +.top_descrption_helper { + font-size: 14px; +} + +.section_inner_title { + margin: 0 0 16px; + font-size: 20px; + font-weight: 500; + line-height: 32px; +} + +.section_inner_title_slave { + line-height: 24px; + margin: 0 0 16px; + font-size: 16px; +} + +/** +* Pages with iframe +*/ +.iframePage { + display: flex; + flex-direction: column; + height: calc(100vh - 100px); +} +.iframePage .mainContainer { + flex-grow: 1; + position: relative; +} +.iframePage .mainContainer iframe { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +#initialContactListsForm #initialContactListsSubmit{ + margin-bottom: 20px; +} + +.allsetup .allsetupGreenLinkDiv{ + +} \ No newline at end of file diff --git a/src/admin/images/LogoMJ_White_RVB.svg b/src/admin/images/LogoMJ_White_RVB.svg new file mode 100644 index 00000000..e9815a8b --- /dev/null +++ b/src/admin/images/LogoMJ_White_RVB.svg @@ -0,0 +1,14 @@ + + + + AC5CD938-096E-4EF0-883A-2FEE57257BD9 + Created with sketchtool. + + + + + + + + + \ No newline at end of file diff --git a/src/admin/images/alert.svg b/src/admin/images/alert.svg new file mode 100644 index 00000000..a6051dca --- /dev/null +++ b/src/admin/images/alert.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/alertPlain.svg b/src/admin/images/alertPlain.svg new file mode 100644 index 00000000..3617ee42 --- /dev/null +++ b/src/admin/images/alertPlain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/all_setup_screen_configure.png b/src/admin/images/all_setup_screen_configure.png new file mode 100644 index 00000000..35ab488e Binary files /dev/null and b/src/admin/images/all_setup_screen_configure.png differ diff --git a/src/admin/images/all_setup_screen_configure_old.png b/src/admin/images/all_setup_screen_configure_old.png new file mode 100644 index 00000000..ee745787 Binary files /dev/null and b/src/admin/images/all_setup_screen_configure_old.png differ diff --git a/src/admin/images/all_setup_screen_send_campaign.png b/src/admin/images/all_setup_screen_send_campaign.png new file mode 100644 index 00000000..ec581da5 Binary files /dev/null and b/src/admin/images/all_setup_screen_send_campaign.png differ diff --git a/src/admin/images/all_setup_screen_send_campaign_old.png b/src/admin/images/all_setup_screen_send_campaign_old.png new file mode 100644 index 00000000..12fefd4a Binary files /dev/null and b/src/admin/images/all_setup_screen_send_campaign_old.png differ diff --git a/src/admin/images/all_setup_screen_signup_to_newsletter.png b/src/admin/images/all_setup_screen_signup_to_newsletter.png new file mode 100644 index 00000000..0f4abde7 Binary files /dev/null and b/src/admin/images/all_setup_screen_signup_to_newsletter.png differ diff --git a/src/admin/images/all_setup_screen_signup_to_newsletter_old.png b/src/admin/images/all_setup_screen_signup_to_newsletter_old.png new file mode 100644 index 00000000..9dd426b9 Binary files /dev/null and b/src/admin/images/all_setup_screen_signup_to_newsletter_old.png differ diff --git a/src/admin/images/carret-down.svg b/src/admin/images/carret-down.svg new file mode 100644 index 00000000..24b27c24 --- /dev/null +++ b/src/admin/images/carret-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/check.svg b/src/admin/images/check.svg new file mode 100644 index 00000000..a390ffe6 --- /dev/null +++ b/src/admin/images/check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/connect_account_screen_icon.png b/src/admin/images/connect_account_screen_icon.png new file mode 100644 index 00000000..3f54a82f Binary files /dev/null and b/src/admin/images/connect_account_screen_icon.png differ diff --git a/src/admin/images/connect_account_screen_icon.svg b/src/admin/images/connect_account_screen_icon.svg new file mode 100644 index 00000000..242a6c3a --- /dev/null +++ b/src/admin/images/connect_account_screen_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/create_contact_list.png b/src/admin/images/create_contact_list.png new file mode 100644 index 00000000..96e96c53 Binary files /dev/null and b/src/admin/images/create_contact_list.png differ diff --git a/src/admin/images/create_contact_list.svg b/src/admin/images/create_contact_list.svg new file mode 100644 index 00000000..56cdea7e --- /dev/null +++ b/src/admin/images/create_contact_list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/dashboard_bottom_left_image.png b/src/admin/images/dashboard_bottom_left_image.png new file mode 100644 index 00000000..89a6ed87 Binary files /dev/null and b/src/admin/images/dashboard_bottom_left_image.png differ diff --git a/src/admin/images/dashboard_bottom_right_image.png b/src/admin/images/dashboard_bottom_right_image.png new file mode 100644 index 00000000..35ab488e Binary files /dev/null and b/src/admin/images/dashboard_bottom_right_image.png differ diff --git a/src/admin/images/dashboard_main_image.png b/src/admin/images/dashboard_main_image.png new file mode 100644 index 00000000..5c7406af Binary files /dev/null and b/src/admin/images/dashboard_main_image.png differ diff --git a/src/admin/images/dashboard_top_left_image.png b/src/admin/images/dashboard_top_left_image.png new file mode 100644 index 00000000..1411942b Binary files /dev/null and b/src/admin/images/dashboard_top_left_image.png differ diff --git a/src/admin/images/dashboard_top_right_image.png b/src/admin/images/dashboard_top_right_image.png new file mode 100644 index 00000000..0f4abde7 Binary files /dev/null and b/src/admin/images/dashboard_top_right_image.png differ diff --git a/src/admin/images/initial_screen_image.png b/src/admin/images/initial_screen_image.png new file mode 100644 index 00000000..7f23268c Binary files /dev/null and b/src/admin/images/initial_screen_image.png differ diff --git a/src/admin/images/initial_screen_image1.png b/src/admin/images/initial_screen_image1.png new file mode 100644 index 00000000..0f4abde7 Binary files /dev/null and b/src/admin/images/initial_screen_image1.png differ diff --git a/src/admin/images/initial_screen_image2.png b/src/admin/images/initial_screen_image2.png new file mode 100644 index 00000000..1411942b Binary files /dev/null and b/src/admin/images/initial_screen_image2.png differ diff --git a/src/admin/images/initial_screen_image3.png b/src/admin/images/initial_screen_image3.png new file mode 100644 index 00000000..ec581da5 Binary files /dev/null and b/src/admin/images/initial_screen_image3.png differ diff --git a/src/admin/images/integ.svg b/src/admin/images/integ.svg new file mode 100644 index 00000000..1d58b377 --- /dev/null +++ b/src/admin/images/integ.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/left_arrow.svg b/src/admin/images/left_arrow.svg new file mode 100644 index 00000000..1c7cbaf3 --- /dev/null +++ b/src/admin/images/left_arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/mj_logo_med.png b/src/admin/images/mj_logo_med.png similarity index 100% rename from assets/images/mj_logo_med.png rename to src/admin/images/mj_logo_med.png diff --git a/assets/images/mj_logo_small.png b/src/admin/images/mj_logo_small.png similarity index 100% rename from assets/images/mj_logo_small.png rename to src/admin/images/mj_logo_small.png diff --git a/src/admin/images/need_help.png b/src/admin/images/need_help.png new file mode 100644 index 00000000..e7dbb00d Binary files /dev/null and b/src/admin/images/need_help.png differ diff --git a/src/admin/images/questionPlain.svg b/src/admin/images/questionPlain.svg new file mode 100644 index 00000000..ca780fc0 --- /dev/null +++ b/src/admin/images/questionPlain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/round-check.svg b/src/admin/images/round-check.svg new file mode 100644 index 00000000..81d55777 --- /dev/null +++ b/src/admin/images/round-check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/sending_options_screen_icon.png b/src/admin/images/sending_options_screen_icon.png new file mode 100644 index 00000000..d20a0071 Binary files /dev/null and b/src/admin/images/sending_options_screen_icon.png differ diff --git a/src/admin/images/sending_options_screen_icon.svg b/src/admin/images/sending_options_screen_icon.svg new file mode 100644 index 00000000..f18fb2ca --- /dev/null +++ b/src/admin/images/sending_options_screen_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/subscription_options_screen_icon.png b/src/admin/images/subscription_options_screen_icon.png new file mode 100644 index 00000000..5a926f90 Binary files /dev/null and b/src/admin/images/subscription_options_screen_icon.png differ diff --git a/src/admin/images/subscription_options_screen_icon.svg b/src/admin/images/subscription_options_screen_icon.svg new file mode 100644 index 00000000..c9f7718c --- /dev/null +++ b/src/admin/images/subscription_options_screen_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/images/user_access_screen_icon.png b/src/admin/images/user_access_screen_icon.png new file mode 100644 index 00000000..739ead6d Binary files /dev/null and b/src/admin/images/user_access_screen_icon.png differ diff --git a/src/admin/images/user_access_screen_icon.svg b/src/admin/images/user_access_screen_icon.svg new file mode 100644 index 00000000..c312be34 --- /dev/null +++ b/src/admin/images/user_access_screen_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/admin/index.php b/src/admin/index.php new file mode 100644 index 00000000..e71af0ef --- /dev/null +++ b/src/admin/index.php @@ -0,0 +1 @@ += 0) { + var hiddenEmailExtra = $('#mailjet_from_email_extra_hidden').val(); + if (hiddenEmailExtra == undefined) { + hiddenEmailExtra = ''; + } + if (!document.querySelector('#mailjet_from_email_extra')) { + $('#mailjet_from_email_fields .fromFldGroup').prepend(''); + } + } else { + $('#mailjet_from_email_extra').remove(); + } + } + ; + $('select[name="mailjet_from_email"]').change(function (e) { + showExtraFromEmailInput($(this)); + }); + showExtraFromEmailInput($('select[name="mailjet_from_email"]')); + + + // Change settings menu links images on hover +// $('.settingsMenuLink a').hover( +// function () { +// $(this).addClass('hover'); +// var imgId = $(this).data('img_id'); +// if ($(this).parent().hasClass('settingsMenuLink1')) { +// $('.' + imgId).css({fill: "#FFFFFF"}); +// } else { +// $('.' + imgId).css({fill: "#19BC9C"}); +// } +// }, +// function () { +// $(this).removeClass('hover'); +// var imgId = $(this).data('img_id'); +// if (!$(this).hasClass('active')) { +// if ($(this).parent().hasClass('settingsMenuLink1')) { +// $('.' + imgId).css({fill: "#FFFFFF"}); +// } else { +// $('.' + imgId).css({fill: "#000000"}); +// } +// } +// } +// ); + + }); +})(jQuery); + +function mjInitShowHide() { + + const btn = document.querySelectorAll('.mj-toggleBtn'); + const expanded = document.querySelectorAll('.mj-show'); + const collapsed = document.querySelectorAll('.mj-hide'); + + if (expanded && expanded.length > 0) { + for (var i = 0; i < expanded.length; i++) { + el = expanded[i]; + el.style.minHeight = el.scrollHeight + 'px'; + } + } + if (collapsed && collapsed.length > 0) { + for (var i = 0; i < collapsed.length; i++) { + el = collapsed[i]; + el.style.height = '0'; + } + } + + if (btn && btn.length > 0) { + for (var i = 0; i < btn.length; i++) { + el = btn[i]; + const target = document.querySelector('#' + el.dataset.target); + function isHidden() { + const classes = target.className.split(' '); + return classes.indexOf('mj-hide') >= 0; + } + + el.addEventListener("click", function () { + isHidden() ? mjShow(target, el) : mjHide(target, el); + }); + } + } +} + +let transitionTimeout; + +function deleteHeight(el, delay) { + transitionTimeout = window.setTimeout(function () { + el.style.height = ''; + }, delay); +} + +function cleardeleteHeight() { + window.clearTimeout(transitionTimeout); +} + +function mjShow(target, btn) { + cleardeleteHeight(); + + target.style.minHeight = '0'; + target.style.minHeight = target.scrollHeight + 'px'; + + target.classList.remove('mj-hide'); + target.classList.add('mj-show'); + btn && btn.classList.add('mj-active'); + + const targetStyles = getComputedStyle(target); + const transitionIndex = targetStyles['transition-property'].replace(/\s+/g, '').split(',').indexOf('min-height'); + const cssTransitionTime = targetStyles['transition-duration'].split(',')[transitionIndex]; + const jsTransitionTime = cssTransitionTime.indexOf('ms') > 0 ? parseFloat(cssTransitionTime) : parseFloat(cssTransitionTime) * 1000; + deleteHeight(target, jsTransitionTime); +} + +function mjHide(target, btn) { + cleardeleteHeight(); + target.style.height = target.scrollHeight + 'px'; + target.style.height = '0'; + target.style.minHeight = '0'; + + target.classList.remove('mj-show'); + target.classList.add('mj-hide'); + btn && btn.classList.remove('mj-active'); +} + +function mjSelect() { + const allSelects = document.querySelectorAll('.mj-select'); + if (allSelects && allSelects.length > 0) { + + for (var i = 0; i < allSelects.length; i++) { + const select = allSelects[i]; + const wrapper = document.createElement('div'); + wrapper.classList.add('mj-select-wrapper'); + select.parentNode.insertBefore(wrapper, select); + wrapper.appendChild(select); + function selectValue() { + return select.querySelector("option:checked").textContent + } + wrapper.setAttribute('data-value', selectValue()); + + select.addEventListener("change", function () { + wrapper.setAttribute('data-value', selectValue()); + }); + select.addEventListener("focus", function () { + wrapper.classList.add('mj-select-focus'); + }); + select.addEventListener("blur", function () { + wrapper.classList.remove('mj-select-focus'); + }); + } + } +} + +function mjSubscription() { + /** + * Handles Contact List form's display + */ + const cancelCLBtn = document.querySelector('#cancel_create_list'); + cancelCLBtn && cancelCLBtn.addEventListener("click", function () { + document.querySelector('#create_contact_list').click(); + }); + + /** + * Show / Hide Initial Sync options div + */ + const autoSubscrBox = document.querySelector('#activate_mailjet_sync'); + const autoSubscrForm = document.querySelector('#activate_mailjet_sync_form'); + + if (autoSubscrBox === null || autoSubscrBox === undefined) { + return false; + } + autoSubscrBox.addEventListener("change", function () { + this.checked === true ? mjShow(autoSubscrForm) : mjHide(autoSubscrForm); + }); + + /** + * Show / Hide Comment Authors Sync div + */ + const contactListBox = document.querySelector('#activate_mailjet_comment_authors_sync'); + const contactList = document.querySelector('#comment_authors_contact_list'); + + if (contactListBox === null || contactListBox === undefined) { + return false; + } + contactListBox.addEventListener("change", function () { + this.checked === true ? mjShow(contactList) : mjHide(contactList); + }); +} + + +function mjWooSubscription() { + + /** + * Show / Hide WooCommerce Integration Activate div + */ + const activateWooIntegrationBox = document.querySelector('#activate_mailjet_woo_integration'); + const wooActicateIntegrationForm = document.querySelector('#activate_mailjet_woo_form'); + + if (activateWooIntegrationBox === null || activateWooIntegrationBox === undefined) { + return false; + } + activateWooIntegrationBox.addEventListener("change", function () { + this.checked === true ? mjShow(wooActicateIntegrationForm) : mjHide(wooActicateIntegrationForm); + }); + + + /** + * Show / Hide WooCommerce Sync div + */ + const wooContactListBox = document.querySelector('#activate_mailjet_woo_sync'); + const wooContactList = document.querySelector('#woo_contact_list'); + + if (wooContactListBox === null || wooContactListBox === undefined) { + return false; + } + wooContactListBox.addEventListener("change", function () { + this.checked === true ? mjShow(wooContactList) : mjHide(wooContactList); + }); +} + +function mjSendingSettings() { + /** + * disable SSL checkbox if port != 465 + */ + const portSelect = document.querySelector('.mjSettings #mailjet_port'); + function getPort() { + return portSelect ? portSelect.value : null; + } + const sslBox = document.querySelector('.mjSettings #mailjet_ssl'); + const sslLabel = sslBox.parentElement.nodeName === "LABEL" ? sslBox.parentElement : null; + + function disableSSL() { + if (getPort() !== "465") { + sslBox.checked = false; + sslBox.setAttribute("disabled", "disabled"); + sslLabel && sslBox.parentElement.classList.add('mj-disabled'); + } else { + sslBox.removeAttribute("disabled"); + sslLabel && sslBox.parentElement.classList.remove('mj-disabled'); + } + } + if (portSelect && sslBox) { + portSelect.addEventListener("change", function () { + disableSSL(); + }); + disableSSL(); + } + /** + * Show Sending email through MJ form + */ + const mjEnabledBox = document.querySelector('.mjSettings #mailjet_enabled'); + const enabledForm = document.querySelector('.mjSettings #enable_mj_emails'); + const mjEnebledRequiredFlds = enabledForm.querySelectorAll('[required]'); + + mjEnabledBox.addEventListener("change", function () { + if (this.checked) { + mjShow(enabledForm); + mjEnebledRequiredFlds.forEach(function (fld) { + fld.setAttribute('required', true); + }); + } else { + mjHide(enabledForm); + mjEnebledRequiredFlds.forEach(function (fld) { + fld.removeAttribute('required'); + }); + } + }); + /** + * Show Test email form + */ +// if (sslBox) { +// const btnTest = document.querySelector('.mjSettings #mailjet_test'); +// sslBox.addEventListener("change", function () { +// this.checked ? mjShow(btnTest) : mjHide(btnTest); +// }); +// } +} +function mjAdmin() { + mjInitShowHide(); + mjSelect(); + if (document.querySelector('body.admin_page_mailjet_initial_contact_lists_page') + || document.querySelector('body.admin_page_mailjet_subscription_options_page') + || document.querySelector('body.admin_page_mailjet_integrations_page')) { + mjSubscription(); + } + if (document.querySelector('body.admin_page_mailjet_integrations_page')) { + mjWooSubscription(); + } + document.querySelector('body.admin_page_mailjet_sending_settings_page') && mjSendingSettings(); +} +document.addEventListener('readystatechange', function (event) { + if (event.target.readyState === "complete") { + mjAdmin(); + } +}); \ No newline at end of file diff --git a/src/admin/partials/MailjetAdminDisplay.php b/src/admin/partials/MailjetAdminDisplay.php new file mode 100644 index 00000000..f808346c --- /dev/null +++ b/src/admin/partials/MailjetAdminDisplay.php @@ -0,0 +1,72 @@ + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    + + */ +class MailjetPublic +{ + /** + * The ID of this plugin. + * + * @since 5.0.0 + * @access private + * @var string $plugin_name The ID of this plugin. + */ + private $plugin_name; + + /** + * The version of this plugin. + * + * @since 5.0.0 + * @access private + * @var string $version The current version of this plugin. + */ + private $version; + + /** + * Initialize the class and set its properties. + * + * @since 5.0.0 + * @param string $plugin_name The name of the plugin. + * @param string $version The version of this plugin. + */ + public function __construct( $plugin_name, $version ) + { + $this->plugin_name = $plugin_name; + $this->version = $version; + } + + /** + * Register the stylesheets for the public-facing side of the site. + * + * @since 5.0.0 + */ + public function enqueue_styles() + { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Mailjet_Loader as all of the hooks are defined + * in that particular class. + * + * The Mailjet_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + + wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mailjet-public.css', array(), $this->version, 'all' ); + } + + /** + * Register the JavaScript for the public-facing side of the site. + * + * @since 5.0.0 + */ + public function enqueue_scripts() + { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Mailjet_Loader as all of the hooks are defined + * in that particular class. + * + * The Mailjet_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + + wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mailjet-public.js', array( 'jquery' ), $this->version, false ); + } +} diff --git a/src/front/css/mailjet-public.css b/src/front/css/mailjet-public.css new file mode 100644 index 00000000..65bbf963 --- /dev/null +++ b/src/front/css/mailjet-public.css @@ -0,0 +1,4 @@ +/** + * All of the CSS for your public-facing functionality should be + * included in this file. + */ \ No newline at end of file diff --git a/src/front/index.php b/src/front/index.php new file mode 100644 index 00000000..e71af0ef --- /dev/null +++ b/src/front/index.php @@ -0,0 +1 @@ + + + diff --git a/src/includes/Mailjet.php b/src/includes/Mailjet.php new file mode 100644 index 00000000..f57e1e78 --- /dev/null +++ b/src/includes/Mailjet.php @@ -0,0 +1,237 @@ + + */ +class Mailjet +{ + /** + * The loader that's responsible for maintaining and registering all hooks that power + * the plugin. + * + * @since 5.0.0 + * @access protected + * @var Mailjet_Loader $loader Maintains and registers all hooks for the plugin. + */ + protected $loader; + + /** + * The unique identifier of this plugin. + * + * @since 5.0.0 + * @access protected + * @var string $plugin_name The string used to uniquely identify this plugin. + */ + protected $plugin_name; + + /** + * The current version of the plugin. + * + * @since 1.0.0 + * @access protected + * @var string $version The current version of the plugin. + */ + protected $version; + + /** + * Define the core functionality of the plugin. + * + * Set the plugin name and the plugin version that can be used throughout the plugin. + * Load the dependencies, define the locale, and set the hooks for the admin area and + * the public-facing side of the site. + * + * @since 5.0.0 + */ + public function __construct() + { + if (defined('MAILJET_VERSION')) { + $this->version = MAILJET_VERSION; + } else { + $this->version = '5.0.6'; + } + $this->plugin_name = 'mailjet'; + + /* + / Activate logger only in debug mode + */ + update_option('mailjet_activate_logger', 0); + + $this->load_dependencies(); + $this->set_locale(); + $this->define_admin_hooks(); + $this->define_public_hooks(); + $this->addMailjetMenu(); + $this->addMailjetSettings(); + $this->addMailjetPHPMailer(); + $this->registerMailjetWidget(); + } + + /** + * Load the required dependencies for this plugin. + * + * Include the following files that make up the plugin: + * + * - Mailjet_Loader. Orchestrates the hooks of the plugin. + * - Mailjeti18n. Defines internationalization functionality. + * - Mailjet_Admin. Defines all hooks for the admin area. + * - Mailjet_Public. Defines all hooks for the public side of the site. + * + * Create an instance of the loader which will be used to register the hooks + * with WordPress. + * + * @since 5.0.0 + * @access private + */ + private function load_dependencies() + { + $this->loader = new MailjetLoader(); + } + + /** + * Define the locale for this plugin for internationalization. + * + * Uses the Mailjeti18n class in order to set the domain and to register the hook + * with WordPress. + * + * @since 5.0.0 + * @access private + */ + private function set_locale() + { + $plugin_i18n = new Mailjeti18n(); + + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); + } + + /** + * Register all of the hooks related to the admin area functionality + * of the plugin. + * + * @since 1.0.0 + * @access private + */ + private function define_admin_hooks() + { + $plugin_admin = new MailjetAdmin($this->get_plugin_name(), $this->get_version()); + + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); + } + + /** + * Register all of the hooks related to the public-facing functionality + * of the plugin. + * + * @since 5.0.0 + * @access private + */ + private function define_public_hooks() + { + $plugin_public = new MailjetPublic($this->get_plugin_name(), $this->get_version()); + + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); + } + + private function addMailjetMenu() + { + $plugin_menu = new MailjetMenu(); + + $this->loader->add_action('admin_menu', $plugin_menu, 'display_menu'); + } + + private function addMailjetSettings() + { + $plugin_settings = new MailjetSettings(); + +// $this->loader->add_action('admin_init', $plugin_settings, 'mailjet_settings_init'); + $this->loader->add_action('init', $plugin_settings, 'mailjet_settings_init'); + } + + private function addMailjetPHPMailer() + { + $plugin_mails = new MailjetMail(); + + $this->loader->add_action('phpmailer_init', $plugin_mails, 'phpmailer_init_smtp'); + $this->loader->add_action('wp_mail_failed', $plugin_mails, 'wp_mail_failed_cb'); + } + + + private function registerMailjetWidget() + { + $this->loader->add_action('widgets_init', $this, 'wp_mailjet_register_widgets'); + } + + function wp_mailjet_register_widgets() + { + register_widget(new WP_Mailjet_Subscribe_Widget()); + } + + /** + * Run the loader to execute all of the hooks with WordPress. + * + * @since 5.0.0 + */ + public function run() + { + $this->loader->run(); + } + + /** + * The name of the plugin used to uniquely identify it within the context of + * WordPress and to define internationalization functionality. + * + * @since 1.0.0 + * @return string The name of the plugin. + */ + public function get_plugin_name() + { + return $this->plugin_name; + } + + /** + * The reference to the class that orchestrates the hooks with the plugin. + * + * @since 5.0.0 + * @return Mailjet_Loader Orchestrates the hooks of the plugin. + */ + public function get_loader() + { + return $this->loader; + } + + /** + * Retrieve the version number of the plugin. + * + * @since 5.0.0 + * @return string The version number of the plugin. + */ + public function get_version() + { + return $this->version; + } + +} diff --git a/src/includes/MailjetActivator.php b/src/includes/MailjetActivator.php new file mode 100644 index 00000000..5399b2e0 --- /dev/null +++ b/src/includes/MailjetActivator.php @@ -0,0 +1,20 @@ + + */ +class MailjetApi +{ + + private static $mjApiClient = null; + + public static function getApiClient() + { + if (self::$mjApiClient instanceof Client) { + return self::$mjApiClient; + } + $mailjetApikey = get_option('mailjet_apikey'); + $mailjetApiSecret = get_option('mailjet_apisecret'); + if (empty($mailjetApikey) || empty($mailjetApiSecret)) { + throw new \Exception('Missing Mailjet API credentials'); + } + + $mjClient = new Client($mailjetApikey, $mailjetApiSecret); + $mjClient->addRequestOption(CURLOPT_USERAGENT, 'wordpress-' . MAILJET_VERSION); + $mjClient->addRequestOption('headers', ['User-Agent' => 'wordpress-' . MAILJET_VERSION]); + + // Add proxy options for guzzle requests - if the Wordpress site is configured to use Proxy + if (defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT') && defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD')) { + $mjClient->addRequestOption(CURLOPT_HTTPPROXYTUNNEL, 1); + $mjClient->addRequestOption(CURLOPT_PROXYAUTH, CURLAUTH_BASIC); + $mjClient->addRequestOption(CURLOPT_PROXY, WP_PROXY_HOST . ':' . WP_PROXY_PORT); + $mjClient->addRequestOption(CURLOPT_PROXYPORT, WP_PROXY_PORT); + $mjClient->addRequestOption(CURLOPT_PROXYUSERPWD, WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD); + } + + // We turn of secure protocol for API requests if the wordpress does not support it + if (empty($_SERVER['HTTPS']) || (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'off') || $_SERVER['SERVER_PORT'] != 443) { + $mjClient->setSecureProtocol(false); + } + + self::$mjApiClient = $mjClient; + return self::$mjApiClient; + } + + public static function getMailjetContactLists() + { + $mjApiClient = self::getApiClient(); + + $filters = [ + 'Limit' => '0', + 'Sort' => 'Name ASC' + ]; + $response = $mjApiClient->get(Resources::$Contactslist, ['filters' => $filters]); + if ($response->success()) { + return $response->getData(); + } else { + //return $response->getStatus(); + return false; + } + } + + public static function createMailjetContactList($listName) + { + if (empty($listName)) { + return false; + } + + $mjApiClient = self::getApiClient(); + + $body = [ + 'Name' => $listName + ]; + $response = $mjApiClient->post(Resources::$Contactslist, ['body' => $body]); + return $response; + } + + public static function isContactListActive($contactListId) + { + if (!$contactListId) { + return false; + } + try { + $mjApiClient = self::getApiClient(); + } catch (\Exception $e) { + return false; + } + $filters = array( + 'ID' => $contactListId + ); + $response = $mjApiClient->get(Resources::$Contactslist, array('filters' => $filters)); + if ($response->success()) { + $data = $response->getData(); + if (isset($data[0]['IsDeleted'])) { + // Return true if the list is not deleted + return !$data[0]['IsDeleted']; + } + } + return false; + } + + public static function getContactProperties() + { + $mjApiClient = self::getApiClient(); + $filters = array( + 'limit' => 0, + 'Sort' => 'Name ASC' + ); + $response = $mjApiClient->get(Resources::$Contactmetadata, array('filters' => $filters)); + if ($response->success()) { + return $response->getData(); + } else { + return false; +// return $response->getStatus(); + } + } + + public static function getPropertyIdByName($name) + { + if (!$name) { + return false; + } + $contactProperties = self::getContactProperties(); + if ($contactProperties) { + foreach ($contactProperties as $property) { + if ($property['Name'] === $name) { + return $property['ID']; + } + } + } + return false; + } + + public static function createMailjetContactProperty($name, $type = "str") + { + if (empty($name)) { + return false; + } + + $mjApiClient = self::getApiClient(); + +// Name: the name of the custom data field +// DataType: the type of data that is being stored (this can be either a str, int, float or bool) +// NameSpace: this can be either static or historic + $body = [ + 'Datatype' => $type, + 'Name' => $name, + 'NameSpace' => "static" + ]; + $response = $mjApiClient->post(Resources::$Contactmetadata, ['body' => $body]); + if ($response->success()) { + return $response->getData(); + } else { + return false; +// return $response->getStatus(); + } + } + + public static function getMailjetSenders() + { + $mjApiClient = self::getApiClient(); + + $filters = [ + 'Limit' => '0', + 'Sort' => 'ID DESC' + ]; + + $response = $mjApiClient->get(Resources::$Sender, ['filters' => $filters]); + if ($response->success()) { + return $response->getData(); + } else { + //return $response->getStatus(); + return false; + } + } + + public static function isValidAPICredentials() + { + try { + $mjApiClient = self::getApiClient(); + } catch (\Exception $e) { + return false; + } + + $filters = [ + 'Limit' => '1' + ]; + + $response = $mjApiClient->get(Resources::$Contactmetadata, ['filters' => $filters]); + if ($response->success()) { + return true; + // return $response->getData(); + } else { + return false; + // return $response->getStatus(); + } + } + + /** + * Add or Remove a contact to a Mailjet contact list - It can process many or single contact at once + * + * @param $contactListId - int - ID of the contact list to sync contacts + * @param $contacts - array('Email' => ContactEmail, 'Name' => ContactName, 'Properties' => array(propertyName1 => propertyValue1, ...)); + * @param string $action - 'addforce', 'adnoforce', 'remove' + * @return array|bool + */ + public static function syncMailjetContacts($contactListId, $contacts, $action = 'addforce') + { + $mjApiClient = self::getApiClient(); + + $body = [ + 'Action' => $action, + 'Contacts' => $contacts + ]; + + $response = $mjApiClient->post(Resources::$ContactslistManagemanycontacts, ['id' => $contactListId, 'body' => $body]); + if ($response->success()) { + return $response->getData(); + } else { + return false; +// return $response->getStatus(); + } + } + + /** + * Add a contact to a Mailjet contact list + */ + public static function syncMailjetContact($contactListId, $contact, $action = 'addforce') + { + $mjApiClient = self::getApiClient(); + $name = isset($contact['Properties']['firstname']) ? $contact['Properties']['firstname'] : ''; + $body = [ + 'Name' => $name, + 'Action' => $action, + 'Email' => $contact['Email'], + 'Properties' => $contact['Properties'] + ]; + $response = $mjApiClient->post(Resources::$ContactslistManagecontact, ['id' => $contactListId, 'body' => $body]); + if ($response->success()) { + return $response->getData(); + } else { + return false; + } + } + + + + /** + * Return TRUE if a contact already subscribed to the list and FALSE if it is not, or is added to the list but Unsubscribed + * + * @param $email + * @param $listId + * @return bool + */ + public static function checkContactSubscribedToList($email, $listId) + { + $exists = false; + $existsAndSubscribed = false; + + $mjApiClient = self::getApiClient(); + + $filters = [ + 'ContactEmail' => $email, + 'ContactsList' => $listId, + ]; + + $response = $mjApiClient->get(Resources::$Listrecipient, ['filters' => $filters]); + + if ($response->success() && $response->getCount() > 0) { + $data = $response->getData(); + $exists = true; + if (isset($data[0]['IsUnsubscribed']) && false == $data[0]['IsUnsubscribed']) { + $existsAndSubscribed = true; + } + } + + return $exists && $existsAndSubscribed; + } + + + +} diff --git a/src/includes/MailjetDeactivator.php b/src/includes/MailjetDeactivator.php new file mode 100644 index 00000000..9d3ff7c0 --- /dev/null +++ b/src/includes/MailjetDeactivator.php @@ -0,0 +1,30 @@ + + */ +class MailjetDeactivator +{ + + /** + * Short Description. (use period) + * + * Long Description. + * + * @since 5.0.0 + */ + public static function deactivate() + { + + } + +} diff --git a/src/includes/MailjetLoader.php b/src/includes/MailjetLoader.php new file mode 100644 index 00000000..b98ff6e1 --- /dev/null +++ b/src/includes/MailjetLoader.php @@ -0,0 +1,124 @@ + + */ +class MailjetLoader +{ + /** + * The array of actions registered with WordPress. + * + * @since 5.0.0 + * @access protected + * @var array $actions The actions registered with WordPress to fire when the plugin loads. + */ + protected $actions; + + /** + * The array of filters registered with WordPress. + * + * @since 5.0.0 + * @access protected + * @var array $filters The filters registered with WordPress to fire when the plugin loads. + */ + protected $filters; + + /** + * Initialize the collections used to maintain the actions and filters. + * + * @since 5.0.0 + */ + public function __construct() + { + $this->actions = array(); + $this->filters = array(); + } + + /** + * Add a new action to the collection to be registered with WordPress. + * + * @since 5.0.0 + * @param string $hook The name of the WordPress action that is being registered. + * @param object $component A reference to the instance of the object on which the action is defined. + * @param string $callback The name of the function definition on the $component. + * @param int $priority Optional. The priority at which the function should be fired. Default is 10. + * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. + */ + public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) + { + $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); + } + + /** + * Add a new filter to the collection to be registered with WordPress. + * + * @since 5.0.0 + * @param string $hook The name of the WordPress filter that is being registered. + * @param object $component A reference to the instance of the object on which the filter is defined. + * @param string $callback The name of the function definition on the $component. + * @param int $priority Optional. The priority at which the function should be fired. Default is 10. + * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 + */ + public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) + { + $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); + } + + /** + * A utility function that is used to register the actions and hooks into a single + * collection. + * + * @since 5.0.0 + * @access private + * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). + * @param string $hook The name of the WordPress filter that is being registered. + * @param object $component A reference to the instance of the object on which the filter is defined. + * @param string $callback The name of the function definition on the $component. + * @param int $priority The priority at which the function should be fired. + * @param int $accepted_args The number of arguments that should be passed to the $callback. + * @return array The collection of actions and filters registered with WordPress. + */ + private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) + { + $hooks[] = array( + 'hook' => $hook, + 'component' => $component, + 'callback' => $callback, + 'priority' => $priority, + 'accepted_args' => $accepted_args + ); + + return $hooks; + + } + + /** + * Register the filters and actions with WordPress. + * + * @since 5.0.0 + */ + public function run() + { + foreach ( $this->filters as $hook ) { + add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); + } + + foreach ( $this->actions as $hook ) { + add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); + } + + } + +} diff --git a/src/includes/MailjetLogger.php b/src/includes/MailjetLogger.php new file mode 100644 index 00000000..1b883231 --- /dev/null +++ b/src/includes/MailjetLogger.php @@ -0,0 +1,72 @@ + + */ +class MailjetMail +{ + const MJ_HOST = 'in-v3.mailjet.com'; + const MJ_MAILER = 'X-Mailer:WP-Mailjet/0.1'; + + public function __construct() + { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + require_once ABSPATH . WPINC . '/class-smtp.php'; + return new \PHPMailer(true); + } + + public function sendMail($mailTransport) + { + try { + //Server settings + $mailTransport->SMTPDebug = 2; // Enable verbose debug output + $mailTransport->isSMTP(); // Set mailer to use SMTP + $mailTransport->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers + $mailTransport->SMTPAuth = true; // Enable SMTP authentication + $mailTransport->Username = 'user@example.com'; // SMTP username + $mailTransport->Password = 'secret'; // SMTP password + $mailTransport->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted + $mail->Port = 587; // TCP port to connect to + + //Recipients + $mailTransport->setFrom('from@example.com', 'Mailer'); + $mailTransport->addAddress('joe@example.net', 'Joe User'); // Add a recipient + $mailTransport->addAddress('ellen@example.com'); // Name is optional + $mailTransport->addReplyTo('info@example.com', 'Information'); + $mailTransport->addCC('cc@example.com'); + $mailTransport->addBCC('bcc@example.com'); + + //Attachments + $mailTransport->addAttachment('/var/tmp/file.tar.gz'); // Add attachments + $mailTransport->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name + + //Content + $mailTransport->isHTML(true); // Set email format to HTML + $mailTransport->Subject = 'Here is the subject'; + $mailTransport->Body = 'This is the HTML message body in bold!'; + $mailTransport->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + $mailTransport->send(); + echo 'Message has been sent'; + } catch (\PHPMailer\PHPMailer\Exception $e) { + echo 'Message could not be sent. Mailer Error: ', $mailTransport->ErrorInfo; + } + } + + public function phpmailer_init_smtp(\PHPMailer $phpmailer) + { + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Configuring SMTP with Mailjet settings - Start ]'); + + if (!get_option('mailjet_enabled') || 0 == get_option('mailjet_enabled')) { + // MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Mailjet not enabled ]'); + return; + } + + $phpmailer->Mailer = 'smtp'; + $phpmailer->SMTPSecure = get_option('mailjet_ssl'); + + $phpmailer->Host = self::MJ_HOST; + $phpmailer->Port = get_option('mailjet_port'); + + $phpmailer->SMTPAuth = TRUE; + $phpmailer->Username = get_option('mailjet_apikey'); + $phpmailer->Password = get_option('mailjet_apisecret'); + + $from_email = (get_option('mailjet_from_email') ? get_option('mailjet_from_email') : get_option('admin_email')); + $phpmailer->From = $from_email; + $phpmailer->Sender = $from_email; + + $phpmailer->FromName = get_option('mailjet_from_name') ? get_option('mailjet_from_name') : get_bloginfo('name'); + + $phpmailer->AddCustomHeader(self::MJ_MAILER); + + //MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Configuring SMTP with Mailjet settings - End ]'); + } + + + public function wp_mail_failed_cb($wpError) + { + add_action('admin_notices', array($this, 'wp_mail_failed_admin_notice')); + if(!get_option('mailjet_enabled')) { + return false; + } + if (function_exists('add_settings_error')) { + add_settings_error('mailjet_messages', 'mailjet_message', 'ERROR - '. $wpError->get_error_message(), 'error'); + } + } + + + public function wp_mail_failed_admin_notice() + { + global $pagenow; + if ($pagenow == 'index.php') { + $user = wp_get_current_user(); + if ($user->exists()) { + echo '
    ' . __('Email sending failed. Please review your smtp configuration and try again later', 'wp-mailjet') . '
    '; + } + } + } + + public static function sendTestEmail() + { + $testSent = false; + if (empty(get_option('mailjet_test_address'))) { + //MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Missing email address to send test email to ]'); + return; + } + // Send a test mail + add_filter('wp_mail_content_type', array('MailjetPlugin\Includes\MailjetMail', 'set_html_content_type')); + $subject = __('Your test mail from Mailjet', 'wp-mailjet'); + $message = sprintf(__('Your Mailjet configuration is ok!
    Site URL: %s
    SSL: %s
    Port: %s', 'wp-mailjet'), get_home_url(), (get_option('mailjet_ssl') ? 'On' : 'Off'), get_option('mailjet_port')); + $testSent = wp_mail(get_option('mailjet_test_address'), $subject, $message); + return $testSent; + } + + public static function set_html_content_type() + { + return 'text/html'; + } + + public function wp_sender_email($original_email_address) { + return get_option('mailjet_from_email'); + } + + public function wp_sender_name($original_email_from) { + return get_option('mailjet_from_name'); + } + +} diff --git a/src/includes/MailjetMenu.php b/src/includes/MailjetMenu.php new file mode 100644 index 00000000..64a9eaf0 --- /dev/null +++ b/src/includes/MailjetMenu.php @@ -0,0 +1,264 @@ + + */ +class MailjetMenu +{ + /** + * Register the filters and actions with WordPress. + * + * @since 5.0.0 + */ + public function display_menu() + { + if ( + current_user_can('administrator') + || + (current_user_can('editor') && get_option('mailjet_access_editor') == 1) + || + (current_user_can('author') && get_option('mailjet_access_author') == 1) + || + (current_user_can('contributor') && get_option('mailjet_access_contributor') == 1) + || + (current_user_can('subscriber') && get_option('mailjet_access_subscriber') == 1) + ) { + + add_menu_page( + __('Connect your Mailjet account to get started', 'wp-mailjet'), + 'Mailjet', + 'manage_options', + 'mailjet_settings_page', + array(new InitialSettings(), 'mailjet_initial_settings_page_html'), + plugin_dir_url( dirname( __FILE__ ) ) . 'admin/images/mj_logo_small.png' + ); + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Mailjet settings menu added ]'); + + if (function_exists('add_submenu_page')) { + add_submenu_page('mailjet_settings_page', __('Connect your Mailjet account to get started', 'wp-mailjet'), + __('Settings', 'wp-mailjet'), 'read', 'mailjet_settings_page', array($this, 'show_settings_page')); + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Initial mailjet API settings sub-menu added ]'); + + add_submenu_page(null, __('Manage your Mailjet lists', 'wp-mailjet'), + __('Lists', 'wp-mailjet'), 'read', 'mailjet_settings_contacts_menu', + array($this, 'show_contacts_page')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'Manage your Mailjet lists\' sub-menu added ]'); + add_submenu_page(null, __('Manage your Mailjet campaigns', 'wp-mailjet'), + __('Campaigns', 'wp-mailjet'), 'read', 'mailjet_settings_campaigns_menu', + array($this, 'show_campaigns_page')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'Manage your Mailjet campaigns\' sub-menu added ]'); + add_submenu_page(null, __('View your Mailjet statistics', 'wp-mailjet'), + __('Statistics', 'wp-mailjet'), 'read', 'mailjet_settings_stats_menu', + array($this, 'show_stats_page')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'View your Mailjet statistics\' sub-menu added ]'); + + // Initial configuration pages + add_submenu_page(null, __('Configure your lists.', 'wp-mailjet'), null, 'read', 'mailjet_initial_contact_lists_page', + array(new InitialContactListsSettings(), 'mailjet_initial_contact_lists_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Initial contact lists configuration sub-menu added ]'); + + // All Setup page + add_submenu_page(null, __('You\'re all set up!', 'wp-mailjet'), null, 'read', 'mailjet_allsetup_page', + array(new AllSetup(), 'mailjet_allsetup_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Mailjet All Setup sub-menu added ]'); + + + // Dashboard page + add_submenu_page(null, __('Welcome to the Mailjet plugin for Wordpress', 'wp-mailjet'), null, 'read', 'mailjet_dashboard_page', + array(new Dashboard(), 'mailjet_dashboard_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Mailjet Dashboard sub-menu added ]'); + + + // Settings pages + add_submenu_page(null, __('Connect your Mailjet account', 'wp-mailjet'), null, 'read', 'mailjet_connect_account_page', + array(new ConnectAccountSettings(), 'mailjet_connect_account_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'Connect your Mailjet account\' sub-menu added ]'); + add_submenu_page(null, __('Sending settings', 'wp-mailjet'), null, 'read', 'mailjet_sending_settings_page', + array(new EnableSendingSettings(), 'mailjet_sending_settings_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'Sending settings\' sub-menu added ]'); + add_submenu_page(null, __('Subscription options', 'wp-mailjet'), null, 'read', 'mailjet_subscription_options_page', + array(new SubscriptionOptionsSettings(), 'mailjet_subscription_options_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'Subscription options\' sub-menu added ]'); + add_submenu_page(null, __('User access', 'wp-mailjet'), null, 'read', 'mailjet_user_access_page', + array(new UserAccessSettings(), 'mailjet_user_access_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'User access\' sub-menu added ]'); + add_submenu_page(null, __('Integrations', 'wp-mailjet'), null, 'read', 'mailjet_integrations_page', + array(new IntegrationsSettings(), 'mailjet_integrations_page_html')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'Integrations\' sub-menu added ]'); + + // Add old initial page to fix settings link after update + add_submenu_page(null, __('Temporary page', 'wp-mailjet'), null, 'read', 'wp_mailjet_options_top_menu', array($this, 'wp_mailjet_options_top')); + + } + } else { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Current user don\'t have required permissions to see Mailjet plugin ]'); + } + } + + public function wp_mailjet_options_top() + { + // Redirect to current initial page + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_settings_page&from=plugins')); + } + + public function show_settings_page() + { +// echo '

    '; +// echo __('Welcome to the Mailjet plugin for Wordpress', 'wp-mailjet'); +// echo '

    '; +// echo __('Mailjet is an email service provider. With this plugin, easily send newsletters to your website users, directly from Wordpress.', 'wp-mailjet'); +// echo '
    '; + } + + + + private function getMailjetIframe() + { + $mailjetApikey = get_option('mailjet_apikey'); + $mailjetApiSecret = get_option('mailjet_apisecret'); + $mailjetIframe = new MailjetIframe($mailjetApikey, $mailjetApiSecret, false); + + $mailjetIframe + ->setCallback('') + ->setTokenExpiration(600) + ->setLocale($this->get_locale()) + ->setTokenAccess(array( + 'campaigns', + 'contacts', + 'stats', + )) + ->turnDocumentationProperties(MailjetIframe::OFF) + ->turnNewContactListCreation(MailjetIframe::ON) + ->turnMenu(MailjetIframe::ON) + ->turnFooter(MailjetIframe::ON) + ->turnBar(MailjetIframe::ON) + ->turnCreateCampaignButton(MailjetIframe::ON) + ->turnSendingPolicy(MailjetIframe::ON); + + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe prepared ]'); + + return $mailjetIframe; + } + + /** + * This method returns the current locale of the wordpress' user + */ + private function get_locale() + { + $locale = get_locale(); + if (in_array($locale, array('de_DE', 'de_DE_formal'))) { + $locale = 'de_DE'; + } + if (!in_array($locale, array('fr_FR', 'en_US', 'en_GB', 'en_EU', 'de_DE', 'es_ES'))) { + $locale = 'en_US'; + } + return $locale; + } + + + public function show_campaigns_page() + { + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe Campaigns page requested ]'); + + echo '
    '; + + try { + $mailjetIframe = $this->getMailjetIframe(); + $mailjetIframe->setInitialPage(\MailjetIframe\MailjetIframe::PAGE_CAMPAIGNS); + echo '
    + Mailjet Logo +
    +
    '; + echo $mailjetIframe->getHtml(); + echo '
    '; + } catch (\MailjetIframe\MailjetException $e) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ ' . $e->getMessage() . ' ]'); + add_settings_error('mailjet_messages', 'mailjet_message', __('Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys', 'wp-mailjet'), 'error'); + settings_errors('mailjet_messages'); + update_option('api_credentials_ok', 0); + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_settings_page')); + } + + echo ''; + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe Campaigns page displayed ]'); + } + + + public function show_stats_page() + { + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe Stats page requested ]'); + + echo '
    '; + + try { + $mailjetIframe = $this->getMailjetIframe(); + $mailjetIframe->setInitialPage(\MailjetIframe\MailjetIframe::PAGE_STATS); + echo '
    + Mailjet Logo +
    +
    '; + echo $mailjetIframe->getHtml(); + echo '
    '; + } catch (\MailjetIframe\MailjetException $e) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ ' . $e->getMessage() . ' ]'); + add_settings_error('mailjet_messages', 'mailjet_message', __('Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys', 'wp-mailjet'), 'error'); + settings_errors('mailjet_messages'); + update_option('api_credentials_ok', 0); + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_settings_page')); + } + echo ''; + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe Stats page displayed ]'); + } + + + public function show_contacts_page() + { + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe Contacts page requested ]'); + + echo '
    '; + + try { + $mailjetIframe = $this->getMailjetIframe(); + $mailjetIframe->setInitialPage(\MailjetIframe\MailjetIframe::PAGE_CONTACTS); + echo '
    + Mailjet Logo +
    +
    '; + echo $mailjetIframe->getHtml(); + echo '
    '; + } catch (\MailjetIframe\MailjetException $e) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ ' . $e->getMessage() . ' ]'); + add_settings_error('mailjet_messages', 'mailjet_message', __('Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys', 'wp-mailjet'), 'error'); + settings_errors('mailjet_messages'); + update_option('api_credentials_ok', 0); + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_settings_page')); + } + echo ''; + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Iframe Contacts page displayed ]'); + } + +} diff --git a/src/includes/MailjetSettings.php b/src/includes/MailjetSettings.php new file mode 100644 index 00000000..89fbf5ab --- /dev/null +++ b/src/includes/MailjetSettings.php @@ -0,0 +1,293 @@ + + */ +class MailjetSettings +{ + /** + * custom option and settings + * IMPORTANT - add each setting here, in order to be processed by the WP Settings API + */ + public function mailjet_settings_init() + { + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Settings Init Start]'); + + $this->addMailjetActions(); + + $this->addSubscriptionConfirmations(); + + // register a new settings for Mailjet pages + register_setting('mailjet_initial_settings_page', 'mailjet_apikey'); + register_setting('mailjet_initial_settings_page', 'mailjet_apisecret'); + register_setting('mailjet_initial_settings_page', 'mailjet_activate_logger'); + register_setting('mailjet_initial_settings_page', 'settings_step'); + + register_setting('mailjet_initial_contact_lists_page', 'activate_mailjet_sync'); + register_setting('mailjet_initial_contact_lists_page', 'mailjet_sync_list'); + register_setting('mailjet_initial_contact_lists_page', 'activate_mailjet_initial_sync'); + register_setting('mailjet_initial_contact_lists_page', 'create_contact_list_btn'); + register_setting('mailjet_initial_contact_lists_page', 'create_list_name'); + register_setting('mailjet_initial_contact_lists_page', 'settings_step'); + + register_setting('mailjet_connect_account_page', 'mailjet_apikey'); + register_setting('mailjet_connect_account_page', 'mailjet_apisecret'); + register_setting('mailjet_connect_account_page', 'settings_step'); + + register_setting('mailjet_sending_settings_page', 'mailjet_enabled'); + register_setting('mailjet_sending_settings_page', 'mailjet_from_name'); + register_setting('mailjet_sending_settings_page', 'mailjet_from_email'); + register_setting('mailjet_sending_settings_page', 'mailjet_port'); + register_setting('mailjet_sending_settings_page', 'mailjet_ssl'); + register_setting('mailjet_sending_settings_page', 'mailjet_from_email_extra'); + register_setting('mailjet_sending_settings_page', 'mailjet_from_email_extra_hidden'); + register_setting('mailjet_sending_settings_page', 'mailjet_test_address'); + register_setting('mailjet_sending_settings_page', 'send_test_email_btn'); + register_setting('mailjet_sending_settings_page', 'settings_step'); + + register_setting('mailjet_subscription_options_page', 'activate_mailjet_sync'); + register_setting('mailjet_subscription_options_page', 'mailjet_sync_list'); + register_setting('mailjet_subscription_options_page', 'activate_mailjet_initial_sync'); + register_setting('mailjet_subscription_options_page', 'activate_mailjet_comment_authors_sync'); + register_setting('mailjet_subscription_options_page', 'mailjet_comment_authors_list'); + register_setting('mailjet_subscription_options_page', 'settings_step'); + + register_setting('mailjet_user_access_page', 'mailjet_access_administrator'); + register_setting('mailjet_user_access_page', 'mailjet_access_editor'); + register_setting('mailjet_user_access_page', 'mailjet_access_author'); + register_setting('mailjet_user_access_page', 'mailjet_access_contributor'); + register_setting('mailjet_user_access_page', 'mailjet_access_subscriber'); + register_setting('mailjet_user_access_page', 'settings_step'); + + register_setting('mailjet_integrations_page', 'activate_mailjet_woo_integration'); + register_setting('mailjet_integrations_page', 'activate_mailjet_woo_sync'); + register_setting('mailjet_integrations_page', 'mailjet_woo_list'); + register_setting('mailjet_integrations_page', 'settings_step'); + + $currentPage = !empty($_REQUEST['page']) ? $_REQUEST['page'] : null; + $fromPage = !empty($_REQUEST['from']) ? $_REQUEST['from'] : null; + if (in_array($currentPage, array( + 'mailjet_allsetup_pagec', + 'mailjet_dashboard_page', + 'mailjet_user_access_page', + 'mailjet_integrations_page', + 'mailjet_subscription_options_page', + 'mailjet_sending_settings_pag', + 'mailjet_connect_account_page', + 'mailjet_initial_contact_lists_page', + 'mailjet_settings_page' + ))) { + if (!($fromPage == 'plugins') && !empty(get_option('api_credentials_ok')) && '1' != get_option('api_credentials_ok')) { + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_settings_page')); + } + } + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Settings Init End ]'); + } + + /** + * Adding a Mailjet logic and functionality to some WP actions - for example - inserting checkboxes for subscription + */ + private function addMailjetActions() + { + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Adding some custom mailjet logic to WP actions - Start ]'); + if (!empty(get_option('activate_mailjet_sync')) && !empty(get_option('mailjet_sync_list'))) { + $subscriptionOptionsSettings = new SubscriptionOptionsSettings(); + + // When user is viewing another users profile page (not their own). + add_action('edit_user_profile', array($subscriptionOptionsSettings, 'mailjet_show_extra_profile_fields')); + // - If you want to apply your hook to ALL profile pages (including the current user) then you also need to use this one. + add_action('show_user_profile', array($subscriptionOptionsSettings, 'mailjet_show_extra_profile_fields')); + + // Runs just before the end of the new user registration form. + add_action('register_form', array($subscriptionOptionsSettings, 'mailjet_show_extra_profile_fields')); + // Runs near the end of the "Add New" user screen. + add_action('user_new_form', array($subscriptionOptionsSettings, 'mailjet_show_extra_profile_fields')); + + // Runs when a user updates personal options from the admin screen. + add_action('personal_options_update', array($subscriptionOptionsSettings, 'mailjet_save_extra_profile_fields')); + // Runs at the end of the Personal Options section of the user profile editing screen. + add_action('profile_personal_options ', array($subscriptionOptionsSettings, 'mailjet_save_extra_profile_fields')); + // + add_action('edit_user_profile_update', array($subscriptionOptionsSettings, 'mailjet_save_extra_profile_fields')); + // Runs when a user's profile is updated. Action function argument: user ID. + add_action('profile_update', array($subscriptionOptionsSettings, 'mailjet_save_extra_profile_fields')); + // Runs immediately after the new user is added to the database. + add_action('user_register', array($subscriptionOptionsSettings, 'mailjet_save_extra_profile_fields')); + } + + /* Add custom field to comment form and process it on form submit */ + if (!empty(get_option('activate_mailjet_comment_authors_sync')) && !empty(get_option('mailjet_comment_authors_list'))) { + $commentAuthorsSettings = new CommentAuthorsSettings(); + + add_action('comment_form_after_fields', array($commentAuthorsSettings, 'mailjet_show_extra_comment_fields')); + add_action('wp_insert_comment', array($commentAuthorsSettings, 'mailjet_subscribe_comment_author')); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Comment Authors Sync active - added custom actions to sync them ]'); + } + + + /* Add custom field to WooCommerce checkout form and process it on form submit */ + if (!empty(get_option('activate_mailjet_woo_integration')) && !empty(get_option('activate_mailjet_woo_sync')) && !empty(get_option('mailjet_woo_list'))) { + $wooCommerceSettings = new WooCommerceSettings(); + + // Add the checkbox + add_action('woocommerce_after_checkout_billing_form', array($wooCommerceSettings, 'mailjet_show_extra_woo_fields'), 10, 2); + // Process the checkbox on submit + add_action('woocommerce_checkout_create_order', array($wooCommerceSettings, 'mailjet_subscribe_woo'), 10, 2); + + // Add filter for changing "Thank you" text on order processed page + add_filter('woocommerce_thankyou_order_received_text', array($wooCommerceSettings, 'woo_change_order_received_text'), 10, 2); + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Comment Authors Sync active - added custom actions to sync them ]'); + } + + + // Add a Link to Mailjet settings page next to the activate/deactivate links in WP Plugins page + add_filter('plugin_action_links', array($this, 'mailjet_settings_link'), 10, 2); + + $currentPage = !empty($_REQUEST['page']) ? $_REQUEST['page'] : null; + if (in_array($currentPage, array('mailjet_initial_contact_lists_page', 'mailjet_sending_settings_page', 'mailjet_subscription_options_page'))) { + if (!MailjetApi::isValidAPICredentials()) { + add_action('admin_notices', array($this, 'apiCredentialsInvalid')); + } + } + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Adding some custom mailjet logic to WP actions - End ]'); + } + + + /** + * Add admin notice saying that current API credentials are not valid + */ + public function apiCredentialsInvalid() + { + add_settings_error('mailjet_messages', 'mailjet_message', __('Your Mailjet API credentials are invalid or not yet configured. Please check and configure them to proceed further.', 'wp-mailjet'), 'error'); + } + + + /** + * Adding a Mailjet logic and functionality to some WP actions - for example - inserting checkboxes for subscription + */ + public function addSubscriptionConfirmations() + { + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Handling subscription confirmations - Start ]'); + + /* Add custom field to comment form and process it on form submit */ + if (!empty(get_option('activate_mailjet_comment_authors_sync')) && !empty(get_option('mailjet_comment_authors_list'))) { + // Verify the token from the confirmation email link and subscribe the comment author to the Mailjet contacts list + if (!empty($_GET['mj_sub_comment_author_token']) && + $_GET['mj_sub_comment_author_token'] == sha1($_GET['subscribe'] . str_ireplace(' ', '+', $_GET['user_email']))) { + $commentAuthorsSettings = new CommentAuthorsSettings(); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Subscribe/Unsubscribe Comment Author To List ]'); + $syncSingleContactEmailToMailjetList = $commentAuthorsSettings->mailjet_subscribe_unsub_comment_author_to_list($_GET['subscribe'], str_ireplace(' ', '+', $_GET['user_email'])); + if (false === $syncSingleContactEmailToMailjetList) { + $this->subsctiptionConfirmationAdminNoticeFailed(); + } else { + $this->subsctiptionConfirmationAdminNoticeSuccess(); + } + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Handling subscription confirmations - End ]'); + } + } + + /* Add custom field to WooCommerce checkout form and process it on form submit */ + if (!empty(get_option('activate_mailjet_woo_integration')) && !empty(get_option('activate_mailjet_woo_sync')) && !empty(get_option('mailjet_woo_list'))) { + // Verify the token from the confirmation email link and subscribe the comment author to the Mailjet contacts list + if (!empty($_GET['mj_sub_woo_token']) && + $_GET['mj_sub_woo_token'] == sha1($_GET['subscribe'] . str_ireplace(' ', '+', $_GET['user_email']) . $_GET['first_name'] . $_GET['last_name'])) { + $wooCommerceSettings = new WooCommerceSettings(); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Subscribe/Unsubscribe WooCommerce user To List ]'); + $syncSingleContactEmailToMailjetList = $wooCommerceSettings->mailjet_subscribe_unsub_woo_to_list($_GET['subscribe'], str_ireplace(' ', '+', $_GET['user_email']), $_GET['first_name'], $_GET['last_name']); + if (false === $syncSingleContactEmailToMailjetList) { + $this->subsctiptionConfirmationAdminNoticeFailed(); + } else { + $this->subsctiptionConfirmationAdminNoticeSuccess(); + } + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Handling subscription confirmations - End ]'); + } + } + + } + + + /** + * Display settings link on plugins page + * + * @param array $links + * @param string $file + * @return array + */ + public function mailjet_settings_link($links, $file) + { + if ($file != plugin_basename(dirname(dirname(dirname(__FILE__)))) . '/wp-mailjet.php') { + return $links; + } + + $settings_link = '' . __('Settings', 'wp-mailjet') . ''; + array_unshift($links, $settings_link); + return $links; + } + + + public function subsctiptionConfirmationAdminNoticeSuccess() + { + if (intval($_GET['subscribe']) > 0) { + $locale = Mailjeti18n::getLocaleByPll(); + $newsletterRegistration = Mailjeti18n::getTranslationsFromFile($locale, 'Newsletter Registration'); + $congratsSubscribed = Mailjeti18n::getTranslationsFromFile($locale, 'Congratulations, you have successfully subscribed!'); + $tankyouPageTemplate = apply_filters('mailjet_thank_you_page_template', plugin_dir_path(__FILE__) . '..'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'thankyou.php'); + // Default page is selected + include($tankyouPageTemplate); +// echo '
    ' . __('You have been successfully subscribed to a Mailjet contact list', 'wp-mailjet') . '
    '; + } else { + echo '
    ' . __('You have been successfully unsubscribed from a Mailjet contact list', 'wp-mailjet') . '
    '; + } + die; //We die here to not continue loading rest of the WP home page + } + + + public function subsctiptionConfirmationAdminNoticeFailed() + { + echo '
    ' . __('Something went wrong with adding a contact to Mailjet contact list', 'wp-mailjet') . '
    '; + die; //We die here to not continue loading rest of the WP home page + } + + + /** + * Automatically redirect to the next step - we use javascript to prevent the WP issue when using `wp_redirect` method and headers already sent + * + * @param $urlToRedirect + */ + public static function redirectJs($urlToRedirect) + { + if (empty($urlToRedirect)) { + return; + } + ?> + + '; + exit; + } +} diff --git a/src/includes/MailjetUpdate.php b/src/includes/MailjetUpdate.php new file mode 100644 index 00000000..38519cf6 --- /dev/null +++ b/src/includes/MailjetUpdate.php @@ -0,0 +1,75 @@ + 0 ? 1 : ''; + add_option('contacts_list_ok', $isContactListOk); + add_option('mailjet_from_email_extra'); + add_option('mailjet_from_email_extra_hidden'); + add_option('send_test_email_btn'); + $authorSync = $commentAuthorsListId > 0 ? 1 : ''; + add_option('activate_mailjet_comment_authors_sync', $authorSync); + + // Delete unused options + $deleteOptions = array( + 'mailjet_username', + 'mailjet_password', + // 'widget_wp_mailjet_subscribe_widget', + 'mailjet_initial_sync_list_id', + 'mailjet_comment_authors_list_id', + 'mailjet_initial_sync_last_date', + 'mailjet_comment_authors_list_date', + 'mailjet_auto_subscribe_list_id', + 'mailjet_user_api_version' + ); + + foreach ($deleteOptions as $option) { + delete_option($option); + } + } +} diff --git a/src/includes/Mailjeti18n.php b/src/includes/Mailjeti18n.php new file mode 100644 index 00000000..a5b863b9 --- /dev/null +++ b/src/includes/Mailjeti18n.php @@ -0,0 +1,215 @@ + + */ +class Mailjeti18n +{ + + public static $supportedLocales = array( + 'English' => 'en_US', + 'French' => 'fr_FR', + 'German' => 'de_DE', + 'Spanish' => 'es_ES', + 'Italian' => 'it_IT', + ); + + /** + * Load the plugin text domain for translation. + * + * @since 5.0.0 + */ + public function load_plugin_textdomain() + { + load_plugin_textdomain( + 'wp-mailjet', false, dirname(dirname(dirname(plugin_basename(__FILE__)))) . '/languages/' + ); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'mailjet\' text domain loaded ]'); + } + + /** + * Provide array with translations in a format [key => message] and a locale to trnaslate to + * + * @param string $locale + * @param array $translations + * @return bool true - if succesfully updated or added translations | false - if something went wrong and translations were not updated + */ + public static function updateTranslationsInFile($locale = 'en_US', array $translations = array()) + { + if (empty($locale) || empty($translations)) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Empty Locale or Translation messages provided ] '); + return false; + } + + $filePo = dirname(dirname(dirname((__FILE__)))) . '/languages/wp-mailjet-' . $locale . '.po'; + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Translations PO file loaded ] - ' . $filePo); + + // Parse a po file + $fileHandler = new \Sepia\PoParser\SourceHandler\FileSystem($filePo); + $poParser = new \Sepia\PoParser\Parser($fileHandler); + $catalog = $poParser->parse(); + + foreach ($translations as $keyToTranslate => $textToTranslate) { + $entry = $catalog->getEntry($keyToTranslate); + if (!empty($entry)) { + $catalog->removeEntry($keyToTranslate); + } + + $catalog->addEntry(new \Sepia\PoParser\Catalog\Entry($keyToTranslate, $textToTranslate)); + } + + // Compile the updated .mo file + $compiler = new \Sepia\PoParser\PoCompiler(); + $fileHandler->save($compiler->compile($catalog)); + + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Translations PO and MO file updated ]'); + + return true; + } + + public static function getTranslationsFromFile($locale, $msgId) + { + $filePo = dirname(dirname(dirname((__FILE__)))) . '/languages/wp-mailjet-' . $locale . '.po'; + if (!file_exists($filePo)) { + return $msgId; + } + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Translations PO file loaded ] - ' . $filePo); + $fileHandler = new \Sepia\PoParser\SourceHandler\FileSystem($filePo); + $poParser = new \Sepia\PoParser\Parser($fileHandler); + $catalog = $poParser->parse(); + $entry = $catalog->getEntry($msgId); + if (empty($entry)) { + return $msgId; + } + return strlen($entry->getMsgStr()) > 0 ? $entry->getMsgStr() : $entry->getMsgId(); + } + + /** + * Get locale, if it is not supported the default en_US is returned + * @return string + */ + public static function getLocale() + { + $locale = get_locale(); + + // de_DE_formal consider as de_DE + if (in_array($locale, array('de_DE', 'de_DE_formal'))) { + $locale = 'de_DE'; + } + + // Use en_US as main if locale is some en + if (in_array($locale, array('en_US', 'en_EN', 'en_GB'))) { + $locale = 'en_US'; + } + + // Use en_US if locale is not supported + if (!in_array($locale, array_values(self::$supportedLocales))) { + $locale = 'en_US'; + } + + return $locale; + } + + public static function getSupportedLocales() + { + return self::$supportedLocales; + } + + /** + * Get user language via locale, if the language is not supported returns the default en_US + * @return string + */ + public static function getCurrentUserLanguage() + { + $locale = self::getLocale(); + $languages = array_flip(self::$supportedLocales); + if (!isset($languages[$locale])) { + // return English if the language is not supported + $locale = 'en_US'; + } + return $languages[$locale]; + } + + public static function getMailjetSupportLinkByLocale() + { + $locale = self::getLocale(); + $supportedLocales = array_flip(self::getSupportedLocales()); + if (!isset($supportedLocales[$locale])) { + // return English if the language is not supported + $locale = 'en_US'; + } + return "https://app.mailjet.com/support?lc=" . $locale; + } + + /** + * Get user locale depends on polylang cookie + * @param str $pll + */ + public static function getLocaleByPll() + { + if (empty($_COOKIE['pll_language'])) { + // The user language is not changed via polylang + return self::getLocale(); + } + + $pll = $_COOKIE['pll_language']; + + switch ($pll) { + case 'en' : $locale = 'en_US'; + break; + case 'fr' : $locale = 'fr_FR'; + break; + case 'de' : $locale = 'de_DE'; + break; + case 'es' : $locale = 'es_ES'; + break; + case 'it' : $locale = 'it_IT'; + break; + // If given pll is not supported get current language + default : $locale = self::getLocale(); + } + return $locale; + } + + public static function getMailjetUserGuideLinkByLocale() + { + $locale = self::getLocale(); + $supportedLocales = array_flip(self::getSupportedLocales()); + if (!isset($supportedLocales[$locale])) { + // return English if the language is not supported + $locale = 'en_US'; + } + + switch ($locale) { + case 'fr_FR': + $link = 'https://www.mailjet.com/guides/wordpress-user-guide-fr/'; + break; + case 'de_DE': + $link = 'https://www.mailjet.com/guides/wordpress-user-guide-de/'; + break; + case 'es_ES': + $link = 'https://www.mailjet.com/guides/wordpress-user-guide-es/'; + break; + case 'it_IT': + $link = 'https://www.mailjet.com/guides/wordpress-user-guide-it/'; + break; + default: + $link = 'https://www.mailjet.com/guides/wordpress-user-guide/'; + } + + return $link; + } + +} diff --git a/src/includes/SettingsPages/AllSetup.php b/src/includes/SettingsPages/AllSetup.php new file mode 100644 index 00000000..41b49bda --- /dev/null +++ b/src/includes/SettingsPages/AllSetup.php @@ -0,0 +1,80 @@ + + */ +class AllSetup +{ + + /** + * top level menu: + * callback functions + */ + public function mailjet_allsetup_page_html() + { + // check user capabilities + if (!current_user_can('manage_options')) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Current user don\'t have \`manage_options\` permission ]'); + return; + } + + ?> +
    +
    Mailjet Logo
    +
    + +

    +

    +
    +
    + +
    +

    +
    +
    +
    + +

    +

    +
    +
    +
    + +
    +

    +
    +
    +
    + +
    + Go to your Mailjet Plugin Homepage', 'wp-mailjet'), "admin.php?page=mailjet_dashboard_page"); ?> +
    + +
    + + +
    + + */ +class CommentAuthorsSettings +{ + public function mailjet_show_extra_comment_fields($user) + { + $user = wp_get_current_user(); + // Display the checkbox only for NOT-logged in users + if (!$user->exists() && get_option('mailjet_comment_authors_list')) { + ?> + + comment_author_email, FILTER_SANITIZE_EMAIL); + $userId = filter_var($comment->user_id, FILTER_SANITIZE_NUMBER_INT); + + // We return if there is no provided email on a new comment - which is the case for WooCommerce - it adds a post and comment when making an order + if (empty($authorEmail)) { + return; + } + + if (!is_email($authorEmail)) { + _e('Invalid email', 'mailjet'); + die; + } + + $subscribe = filter_var($_POST['mailjet_comment_authors_subscribe_ok'], FILTER_SANITIZE_NUMBER_INT); + $this->mailjet_subscribe_confirmation_from_comment_form($subscribe, $authorEmail); + } + + + /** + * Subscribe or unsubscribe a wordpress comment author in/from a Mailjet's contact list when the comment is saved + */ + public function mailjet_subscribe_unsub_comment_author_to_list($subscribe, $user_email) + { + $action = intval($subscribe) === 1 ? 'addforce' : 'remove'; + // Add the user to a contact list + return SubscriptionOptionsSettings::syncSingleContactEmailToMailjetList(get_option('mailjet_comment_authors_list'), $user_email, $action); + } + + + + /** + * Email the collected widget data to the customer with a verification token + * @param void + * @return void + */ + public function mailjet_subscribe_confirmation_from_comment_form($subscribe, $user_email) + { + $error = empty($user_email) ? 'Email field is empty' : false; + if (false !== $error) { + _e($error, 'mailjet'); + die; + } + + // We return if there is no provided email on a new comment - which is the case for WooCommerce - it adds a post and comment when making an order + if (empty($user_email)) { + return; + } + + if (!is_email($user_email)) { + _e('Invalid email', 'mailjet'); + die; + } + $wpUrl = sprintf('%s', get_home_url(), get_home_url()); + $message = file_get_contents(dirname(dirname(dirname(__FILE__))) . '/templates/confirm-subscription-email.php'); + $emailParams = array( + '__EMAIL_TITLE__' => __('Please confirm your subscription', 'mailjet'), + '__EMAIL_HEADER__' => sprintf(__('To receive newsletters from %s please confirm your subscription by clicking the following button:', 'mailjet'), $wpUrl), + '__WP_URL__' => $wpUrl, + '__CONFIRM_URL__' => get_home_url() . '?subscribe=' . $subscribe . '&user_email=' . $user_email . '&mj_sub_comment_author_token=' . sha1($subscribe . $user_email), + '__CLICK_HERE__' => __('Yes, subscribe me to this list', 'mailjet'), + '__FROM_NAME__' => get_option('blogname'), + '__IGNORE__' => __('If you received this email by mistake or don\'t wish to subscribe anymore, simply ignore this message.', 'mailjet'), + ); + foreach ($emailParams as $key => $value) { + $message = str_replace($key, $value, $message); + } + + $email_subject = __('Subscription Confirmation', 'mailjet'); + add_filter('wp_mail_content_type', array(new SubscriptionOptionsSettings(), 'set_html_content_type')); + wp_mail($_POST['email'], $email_subject, $message, + array('From: ' . get_option('blogname') . ' <' . get_option('admin_email') . '>')); + } +} diff --git a/src/includes/SettingsPages/ConnectAccountSettings.php b/src/includes/SettingsPages/ConnectAccountSettings.php new file mode 100644 index 00000000..752489b1 --- /dev/null +++ b/src/includes/SettingsPages/ConnectAccountSettings.php @@ -0,0 +1,175 @@ + + */ +class ConnectAccountSettings +{ + + public function mailjet_section_connect_account_cb($args) + { + ?> +

    + My Account > API Keys and paste your credentials bellow', 'wp-mailjet'); ?> +

    + +
    + + + + + + + +
    + 'mailjet_connect_account_settings', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // add error/update messages + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + + // Validate Mailjet API credentials + $isValidAPICredentials = MailjetApi::isValidAPICredentials(); + if (false == $isValidAPICredentials) { +// ailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Invalid Mailjet API credentials ]'); + add_settings_error('mailjet_messages', 'mailjet_message', __('Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys', 'wp-mailjet'), 'error'); + } else { +// MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Initial settings form submitted ]'); + // Initialize PhpMailer + // + if (!is_object($phpmailer) || !is_a($phpmailer, 'PHPMailer')) { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + require_once ABSPATH . WPINC . '/class-smtp.php'; + $phpmailer = new \PHPMailer(); +// MailjetLogger::warning('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ PHPMailer initialized by the Mailjet plugin ]'); + } + + // Update From Email and Name + add_filter('wp_mail_from', array(new MailjetMail(), 'wp_sender_email')); + add_filter('wp_mail_from_name', array(new MailjetMail(), 'wp_sender_name')); + + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('Settings Saved', 'wp-mailjet'), 'updated'); +// MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Initial settings saved successfully ]'); + } + } + + // show error/update messages + settings_errors('mailjet_messages'); + ?> + +
    +
    Mailjet Logo
    +
    + + + +

    +
    +
    + +
    + +
    +
    + +

    +
    + + + +
    +
    +
    +
    +
    + + +
    + + + */ +class Dashboard +{ + + /** + * top level menu: + * callback functions + */ + public function mailjet_dashboard_page_html() + { + // check user capabilities + if (!current_user_can('manage_options')) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Current user don\'t have \`manage_options\` permission ]'); + return; + } + + ?> +
    +
    Mailjet Logo
    +
    + +

    + +
    +
    +

    +

    + +
    +
    + +
    +
    + +

    +

    + +
    +
    + +

    +

    + +
    +
    + +

    +

    + +
    +
    + +

    +

    + +
    +
    +
    +
    + + +
    + + */ +class EnableSendingSettings +{ + public function mailjet_section_enable_sending_cb($args) + { + ?> +

    + +

    + + +
    + +
    +
    + + +
    +
    + +
    + +
    +
    + + + +
    + + +
    +
    + +
    +
    + + +
    + +
    + +
    + +
    + + +
    +
    +
    + 'mailjet_enable_sending', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // check user capabilities + if (!current_user_can('manage_options')) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Current user don\'t have \`manage_options\` permission ]'); + return; + } + + // add error/update messages + + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + + $executionError = false; + $testSent = false; + + // Initialize PhpMailer + // + if (!is_object($phpmailer) || !is_a($phpmailer, 'PHPMailer')) { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + require_once ABSPATH . WPINC . '/class-smtp.php'; + $phpmailer = new \PHPMailer(); + } + + // If whitelisted domain is selected then we add the extra email name to that domain + if (!empty(get_option('mailjet_from_email_extra'))) { + update_option('mailjet_from_email', str_replace('*', '',get_option('mailjet_from_email_extra').get_option('mailjet_from_email'))); + } + + // Update From Email and Name + add_filter('wp_mail_from', array(new MailjetMail(), 'wp_sender_email')); + add_filter('wp_mail_from_name', array(new MailjetMail(), 'wp_sender_name')); + + // Check connection with selected port and protocol + if (false === $this->checkConnection()) { + $executionError = true; + add_settings_error('mailjet_messages', 'mailjet_message', __('Can not connect to Mailjet with the selected settings. Check if a firewall is blocking connections to the Mailjet ports.', 'wp-mailjet'), 'error'); + } + + if (!empty(get_option('send_test_email_btn')) && empty(get_option('mailjet_test_address'))) { + $executionError = true; + add_settings_error('mailjet_messages', 'mailjet_message', __('Please provide a valid email address', 'wp-mailjet'), 'error'); + } else if (!empty(get_option('send_test_email_btn')) && !empty(get_option('mailjet_test_address'))) { + // Send a test email + $testSent = MailjetMail::sendTestEmail(); + if (false === $testSent) { + //MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Your test message was NOT sent, please review your settings ]'); + $executionError = true; + add_settings_error('mailjet_messages', 'mailjet_message', __('The test email could not be sent. Please make sure your server doesn\'t block the SMTP ports. Also double check that you are using correct API and Secret keys and a valid sending address from your Mailjet account.', 'wp-mailjet'), 'error'); + } else { + // MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Your test message was sent succesfully ]'); + add_settings_error('mailjet_messages', 'mailjet_message', __('Your test email has been successfully sent', 'wp-mailjet'), 'updated'); + } + } + + if (true !== $testSent && false === $executionError) { + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('Settings Saved', 'wp-mailjet'), 'updated'); + } + } + + // show error/update messages + settings_errors('mailjet_messages'); + + ?> + +
    +
    Mailjet Logo
    +
    + + + +

    +
    +
    + +
    + +
    +
    + +

    +
    + + + +
    +
    +
    +
    +
    + + +
    + + + */ +class InitialContactListsSettings +{ + + public function mailjet_section_initial_contact_lists_cb($args) + { + ?> +

    +

    + +

    + array('ID', 'user_email'))); + $wpUsersCount = count($allWpUsers); + try { + $mailjetContactLists = MailjetApi::getMailjetContactLists(); + } catch (\Exception $ex) { + update_option('api_credentials_ok', 0); + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_settings_page')); + die; + } + + $mailjetContactLists = !empty($mailjetContactLists) ? $mailjetContactLists : array(); + $mailjetSyncActivated = get_option('activate_mailjet_sync'); + $mailjetInitialSyncActivated = get_option('activate_mailjet_initial_sync'); + $mailjetSyncList = get_option('mailjet_sync_list'); + + // output the field + ?> + +
    +

    +
    +
    + +
    + + +
    + +
    +
    + + <?php echo __('Create a new list', 'wp-mailjet'); ?> + + +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +

    +

    + +
    + + +
    +
    + + +
    +
    +
    +
    + + + + 'mailjet_initial_contact_lists', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // check user capabilities + if (!current_user_can('manage_options')) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Current user don\'t have \`manage_options\` permission ]'); + return; + } + + // add error/update messages + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + + $executionError = false; + $applyAndContinueBtnClicked = false; + + // Initial sync WP users to Mailjet - when the 'create_contact_list_btn' button is not the one that submits the form + if (empty(get_option('create_contact_list_btn')) && !empty(get_option('activate_mailjet_initial_sync')) && intval(get_option('mailjet_sync_list')) > 0) { + $syncResponse = SubscriptionOptionsSettings::syncAllWpUsers(); + if (false === $syncResponse) { + $executionError = true; + update_option('contacts_list_ok', 0); + add_settings_error('mailjet_messages', 'mailjet_message', __('The settings could not be saved. Please try again or in case the problem persists contact Mailjet support.', 'wp-mailjet'), 'error'); + } + } + + // Create new Contact List + if (!empty(get_option('create_contact_list_btn'))) { + if (!empty(get_option('create_list_name'))) { + $createListResponse = MailjetApi::createMailjetContactList(get_option('create_list_name')); + + if ($createListResponse->success()) { + add_settings_error('mailjet_messages', 'mailjet_message', __('Congratulations! You have just created a new contact list!', 'wp-mailjet'), 'updated'); + } else { + $executionError = true; + update_option('contacts_list_ok', 0); + + if (isset($createListResponse->getBody()['ErrorMessage']) && stristr($createListResponse->getBody()['ErrorMessage'], 'already exists')) { + add_settings_error('mailjet_messages', 'mailjet_message', sprintf(__('A contact list with name %s already exists', 'wp-mailjet'), get_option('create_list_name')), 'error'); + } else { + $executionError = true; + update_option('contacts_list_ok', 0); + + add_settings_error('mailjet_messages', 'mailjet_message', __('The settings could not be saved. Please try again or in case the problem persists contact Mailjet support.', 'wp-mailjet'), 'error'); + } + } + } else { // New list name empty + $executionError = true; + add_settings_error('mailjet_messages', 'mailjet_message', __('Please enter a valid contact list name', 'wp-mailjet'), 'error'); + } + } else { + $applyAndContinueBtnClicked = true; + } + + if (false === $executionError) { + update_option('contacts_list_ok', 1); + + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('Settings Saved', 'wp-mailjet'), 'updated'); + + if (!($fromPage == 'plugins') || (!empty(get_option('contacts_list_ok')) && '1' == get_option('contacts_list_ok'))) { + + // Redirect if the create contact button is not set + if (empty(get_option('create_contact_list_btn'))) { + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_allsetup_page')); + } + } + } + } + if (!($fromPage == 'plugins') && (!empty(get_option('contacts_list_ok')) && '1' == get_option('contacts_list_ok'))) { + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_dashboard_page')); + } + + // show error/update messages + settings_errors('mailjet_messages'); + ?> + +
    +
    Mailjet Logo
    +
    + +
    +

    +

    + +

    +
    + +
    +
    + + + + + + + + +
    +
    +
    + +
    + + +
    + + + */ +class InitialSettings +{ + + /** + * custom option and settings: + * callback functions + */ + // developers section cb + // section callbacks can accept an $args parameter, which is an array. + // $args have the following keys defined: title, id, callback. + // the values are defined at the add_settings_section() function. + public function mailjet_section_initial_settings_cb($args) + { + ?> +

    + My Account > API Keys and paste your credentials below', 'wp-mailjet'); ?> +

    + . + // the "class" key value is used for the "class" attribute of the containing the field. + // you can add custom key value pairs to be used inside your callbacks. + public function mailjet_initial_settings_cb($args) + { + // get the value of the setting we've registered with register_setting() + $mailjetApikey = get_option('mailjet_apikey'); + $mailjetApiSecret = get_option('mailjet_apisecret'); + $mailjetActivateLogger = get_option('mailjet_activate_logger'); + + // output the field + ?> +
    + + + + + + + + +
    + + + + + + + 'initial_settings', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // add error/update messages + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + + $executionError = false; + + // Validate Mailjet API credentials + $isValidAPICredentials = MailjetApi::isValidAPICredentials(); + if (false == $isValidAPICredentials) { + update_option('api_credentials_ok', 0); + $executionError = true; +// MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Invalid Mailjet API credentials ]'); + add_settings_error('mailjet_messages', 'mailjet_message', __('Please make sure that you are using the correct API key and Secret key associated to your Mailjet account: https://app.mailjet.com/account/api_keys', 'wp-mailjet'), 'error'); + } else { +// MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Initial settings form submitted ]'); + // Initialize PhpMailer + // + if (!is_object($phpmailer) || !is_a($phpmailer, 'PHPMailer')) { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + require_once ABSPATH . WPINC . '/class-smtp.php'; + $phpmailer = new \PHPMailer(); +// MailjetLogger::warning('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ PHPMailer initialized by the Mailjet plugin ]'); + } + + // Update From Email and Name + add_filter('wp_mail_from', array(new MailjetMail(), 'wp_sender_email')); + add_filter('wp_mail_from_name', array(new MailjetMail(), 'wp_sender_name')); + + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('Settings Saved', 'wp-mailjet'), 'updated'); + $executionError = false; + + // Automatically redirect to the next step - we use javascript to prevent the WP issue when using `wp_redirect` method and headers already sent + if (false === $executionError) { + // Update the flag for passed API credentials check + update_option('api_credentials_ok', 1); + // Redirect to the next page + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_initial_contact_lists_page' . (!empty($_REQUEST['from']) ? '&from=' . $_REQUEST['from'] : ''))); + } + + //MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Initial settings saved successfully ]'); + } + } + if (!($fromPage == 'plugins') && (!empty(get_option('api_credentials_ok')) && '1' == get_option('api_credentials_ok'))) { + MailjetSettings::redirectJs(admin_url('/admin.php?page=mailjet_initial_contact_lists_page')); + } + + //// show error/update messages + settings_errors('mailjet_messages'); + ?> +
    +
    Mailjet Logo
    +
    + +
    +

    +

    + +

    +
    +
    +
    +

    +
    + + + + + +
    +
    + +
    +
    +
    +
    Welcome to the Mailjet
    +

    +
    +
    +
    Welcome to the Mailjet
    +

    +
    +
    +
    Welcome to the Mailjet
    +

    +
    +
    +
    +
    +
    + + +
    + + + */ +class IntegrationsSettings +{ + + public function mailjet_section_integrations_cb($args) + { +// ?> + + + + + +
    + + + + +
    + + +
    + +
    +
    +
    + + + + 'mailjet_integrations', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // add error/update messages + + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + $executionError = false; + + // Check if selected Contact list - only if the Sync checkbox is checked + if (!empty(get_option('activate_mailjet_woo_sync')) && !intval(get_option('mailjet_woo_list')) > 0) { + $executionError = true; + add_settings_error('mailjet_messages', 'mailjet_message', __('The settings could not be saved. Please select a contact list to subscribe WooCommerce users to.', 'wp-mailjet'), 'error'); + } + + if (false === $executionError) { + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('Settings Saved', 'wp-mailjet'), 'updated'); + } + } + + // show error/update messages + settings_errors('mailjet_messages'); + + + ?> +
    +
    Mailjet Logo
    +
    + + + +

    +
    +
    + +
    + +
    +
    + +

    +
    + + + +
    +
    +
    +
    +
    + + +
    + + + */ +class SubscriptionOptionsSettings +{ + + const WIDGET_HASH = '[\^=34|>5i!? {xIas'; + + public function mailjet_section_subscription_options_cb($args) + { + ?> +

    + +

    + array('ID', 'user_email'))); + $wpUsersCount = count($allWpUsers); + $mailjetContactLists = MailjetApi::getMailjetContactLists(); + $mailjetContactLists = !empty($mailjetContactLists) ? $mailjetContactLists : array(); + $mailjetSyncActivated = get_option('activate_mailjet_sync'); + $mailjetInitialSyncActivated = get_option('activate_mailjet_initial_sync'); + $mailjetSyncList = get_option('mailjet_sync_list'); + $mailjetCommentAuthorsList = get_option('mailjet_comment_authors_list'); + $mailjetCommentAuthorsSyncActivated = get_option('activate_mailjet_comment_authors_sync'); + + + // output the field + ?> + +
    + + + + +
    +
    + + +
    +
    + + + + +
    + +
    + +
    + + + + 'mailjet_subscription_options', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // add error/update messages + + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + $executionError = false; + // Initial sync WP users to Mailjet + if (!empty(get_option('activate_mailjet_initial_sync')) && intval(get_option('mailjet_sync_list')) > 0) { + $syncResponse = self::syncAllWpUsers(); + if (false === $syncResponse) { + $executionError = true; + add_settings_error('mailjet_messages', 'mailjet_message', __('The settings could not be saved. Please try again or in case the problem persists contact Mailjet support.', 'wp-mailjet'), 'error'); + } + } + if (false === $executionError) { + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('Settings Saved', 'wp-mailjet'), 'updated'); + } + } + + // show error/update messages + settings_errors('mailjet_messages'); + + + ?> +
    +
    Mailjet Logo
    +
    + + + +

    +
    +
    + +
    + +
    +
    + +

    +
    + + + +
    +
    +
    +
    +
    + + +
    + + array('ID', 'user_email'))); + if (!(count($users) > 0)) { + add_settings_error('mailjet_messages', 'mailjet_message', __('No Wordpress users to add to Mailjet contact list', 'wp-mailjet'), 'error'); + return false; + } + + if (false === self::syncContactsToMailjetList($contactListId, $users, 'addforce')) { + add_settings_error('mailjet_messages', 'mailjet_message', __('Something went wrong with adding existing Wordpress users to your Mailjet contact list', 'wp-mailjet'), 'error'); + return false; + } else { + add_settings_error('mailjet_messages', 'mailjet_message', __('All Wordpress users were successfully added to your Mailjet contact list', 'wp-mailjet'), 'updated'); + } + return true; + } + + + /** + * Add or Remove a contact to Mailjet contact list + * + * @param $contactListId + * @param $users - can be array of users or a single user + * @param $action - addnoforce, addforce, remove + * @return array|bool|int + */ + public static function syncContactsToMailjetList($contactListId, $users, $action) + { + $contacts = array(); + + if (!is_array($users)) { + $users = array($users); + } + + foreach ($users as $user) { + $userInfo = get_userdata($user->ID); + $userRoles = $userInfo->roles; + $userMetadata = get_user_meta($user->ID); + $userNames = ''; + + $contactProperties = array(); + if (!empty($userMetadata['first_name'][0])) { + $contactProperties['firstname'] = $userMetadata['first_name'][0]; + $userNames = $contactProperties['firstname']; + } + if (!empty($userMetadata['last_name'][0])) { + $contactProperties['lastname'] = $userMetadata['last_name'][0]; + $userNames.= ' ' . $contactProperties['lastname']; + } + if (!empty($userRoles[0])) { + $contactProperties['wp_user_role'] = $userRoles[0]; + } + + $contacts[] = array( + 'Email' => $user->user_email, + 'Name' => $userNames, + 'Properties' => $contactProperties + ); + } + + return MailjetApi::syncMailjetContacts($contactListId, $contacts, $action); + } + + + public static function syncSingleContactEmailToMailjetList($contactListId, $email, $action, $contactProperties = []) + { + if (empty($email)) { + return false; + } + + $contact = []; + $contact['Email'] = $email; + if (!empty($contactProperties)) { + $contact['Properties'] = $contactProperties; + } + + return MailjetApi::syncMailjetContact($contactListId, $contact, $action); + } + + + + + /** + * Adding checkboxes and extra fields for subscribing user and comment authors + */ + public function mailjet_show_extra_profile_fields($user) + { + // If contact list is not selected, then do not show the extra fields + if (!empty(get_option('activate_mailjet_sync')) && !empty(get_option('mailjet_sync_list'))) { + // Update the extra fields + if (is_object($user) && intval($user->ID) > 0) { + $this->mailjet_subscribe_unsub_user_to_list(esc_attr(get_the_author_meta('mailjet_subscribe_ok', $user->ID)), $user->ID); + } + ?> + +
    + mailjet_subscribe_unsub_user_to_list($subscribe, $user_id); + } + + + /** + * Subscribe or unsubscribe a wordpress user (admin, editor, etc.) in/from a Mailjet's contact list when the profile is saved + */ + public function mailjet_subscribe_unsub_user_to_list($subscribe, $user_id) + { + if (!empty(get_option('mailjet_sync_list'))) { + $user = get_userdata($user_id); + $action = intval($subscribe) === 1 ? 'addforce' : 'remove'; + // Add the user to a contact list + if (false == SubscriptionOptionsSettings::syncContactsToMailjetList(get_option('mailjet_sync_list'), $user, $action)) { + return false; + } else { + return true; + } + } + } + + + + public function mailjet_subscribe_confirmation_from_widget($subscription_email, $instance, $subscription_locale) + { + $homeUrl = get_home_url(); + $language = Mailjeti18n::getCurrentUserLanguage(); + $thankYouPageId = !empty($instance[$language]['thank_you']) ? $instance[$language]['thank_you'] : false; + $post = get_post( $thankYouPageId ); + $thankYouURI = !empty($post->guid) ? $post->guid : $homeUrl; + $locale = Mailjeti18n::getLocale(); + + $email_subject = !empty($instance[$locale]['email_subject']) ? apply_filters('widget_email_subject', $instance[$locale]['email_subject']) : Mailjeti18n::getTranslationsFromFile($locale, 'Subscription Confirmation'); + $email_title = !empty($instance[$locale]['email_content_title']) ? apply_filters('widget_email_content_title', $instance[$locale]['email_content_title']) : Mailjeti18n::getTranslationsFromFile($locale, 'Please confirm your subscription'); + $email_button_value = !empty($instance[$locale]['email_content_confirm_button']) ? apply_filters('widget_email_content_confirm_button', $instance[$locale]['email_content_confirm_button']) : Mailjeti18n::getTranslationsFromFile($locale, 'Yes, subscribe me to this list'); + $wpUrl = sprintf('%s', $homeUrl, $homeUrl); + $test = sprintf(Mailjeti18n::getTranslationsFromFile($locale, 'To receive newsletters from %s please confirm your subscription by clicking the following button:'), $wpUrl); +// $test = sprintf(__('To receive newsletters from %s please confirm your subscription by clicking the following button:', 'wp-mailjet'), $wpUrl); + $email_main_text = !empty($instance[$locale]['email_content_main_text']) ? apply_filters('widget_email_content_main_text', sprintf($instance[$locale]['email_content_main_text'], get_option('blogname'))) : $test; + $email_content_after_button = !empty($instance[$locale]['email_content_after_button']) ? $instance[$locale]['email_content_after_button'] : Mailjeti18n::getTranslationsFromFile($locale, 'If you received this email by mistake or don\'t wish to subscribe anymore, simply ignore this message.'); + $properties = isset($_POST['properties']) ? $_POST['properties'] : array(); + $params = http_build_query(array( + 'subscription_email' => $subscription_email, + 'subscription_locale' => $subscription_locale, + 'properties' => $properties, +// 'thank_id' => $thankYouURI + )); + $subscriptionTemplate = apply_filters('mailjet_confirmation_email_filename', dirname(dirname(dirname(__FILE__))) . '/templates/confirm-subscription-email.php'); + $message = file_get_contents($subscriptionTemplate); + + // Check if subscription is done via home page or some post + $confirmUrl = $thankYouURI == $homeUrl ? '?' : '&'; + + $emailData = array( + '__EMAIL_TITLE__' => $email_title, + '__EMAIL_HEADER__' => $email_main_text, + '__WP_URL__' => $homeUrl, + '__CONFIRM_URL__' => $thankYouURI . $confirmUrl . $params . '&mj_sub_token=' . sha1($params . self::WIDGET_HASH), + '__CLICK_HERE__' => $email_button_value, + '__FROM_NAME__' => $homeUrl, //get_option('blogname'), + '__IGNORE__' => $email_content_after_button, + ); + $emailParams = apply_filters('mailjet_subscription_widget_email_params', $emailData); + foreach ($emailParams as $key => $value) { + $message = str_replace($key, $value, $message); + } + add_filter('wp_mail_content_type', array($this, 'set_html_content_type')); + return wp_mail($subscription_email, $email_subject, $message, array('From: ' . get_option('blogname') . ' <' . get_option('admin_email') . '>')); +// echo '

    ' . __('Subscription confirmation email sent. Please check your inbox and confirm the subscription.', 'wp-mailjet') . '

    '; +// die; + } + + public function set_html_content_type() + { + return 'text/html'; + } + +} diff --git a/src/includes/SettingsPages/UserAccessSettings.php b/src/includes/SettingsPages/UserAccessSettings.php new file mode 100644 index 00000000..d94155a4 --- /dev/null +++ b/src/includes/SettingsPages/UserAccessSettings.php @@ -0,0 +1,182 @@ + + */ +class UserAccessSettings +{ + + public function mailjet_section_user_access_cb($args) + { + ?> +

    + +

    + + +
    + + + + + + +
    + + + + 'mailjet_user_access', + 'class' => 'mailjet_row', + 'mailjet_custom_data' => 'custom', + ] + ); + + + // add error/update messages + + // check if the user have submitted the settings + // wordpress will add the "settings-updated" $_GET parameter to the url + if (isset($_GET['settings-updated'])) { + + // add settings saved message with the class of "updated" + add_settings_error('mailjet_messages', 'mailjet_message', __('User Access Settings Saved', 'wp-mailjet'), 'updated'); + } + + // show error/update messages + settings_errors('mailjet_messages'); + + ?> + +
    +
    Mailjet Logo
    +
    + + + +

    +
    +
    + +
    + +
    +
    + +

    +
    + + + +
    +
    +
    +
    +
    + + +
    + + + */ +class WooCommerceSettings +{ + public function mailjet_show_extra_woo_fields($checkout) + { + $user = wp_get_current_user(); + + // Display the checkbox only for NOT-logged in users or for logged-in but not subscribed to the Woo list + if (get_option('activate_mailjet_woo_integration') && get_option('mailjet_woo_list')){ + + // Check if user is logged-in and already Subscribed to the contact list + if ($user->exists()) { + $contactAlreadySubscribedToList = MailjetApi::checkContactSubscribedToList($user->data->user_email, get_option('mailjet_woo_list')); + } + + if (!$user->exists() || false == $contactAlreadySubscribedToList) { + if (!function_exists('woocommerce_form_field')) { + return; + } + woocommerce_form_field('mailjet_woo_subscribe_ok', array( + 'type' => 'checkbox', + 'label' => __('Subscribe to our newsletter', 'mailjet'), + 'required' => false, + ), $checkout->get_value('mailjet_woo_subscribe_ok')); + } + } + } + + + public function mailjet_subscribe_woo($order, $data) + { + $wooUserEmail = filter_var($order->get_billing_email(), FILTER_SANITIZE_EMAIL); + $firstName = $order->get_billing_first_name(); + $lastName = $order->get_billing_last_name(); + + if (!is_email($wooUserEmail)) { + _e('Invalid email', 'mailjet'); + die; + } + + if( isset($_POST['_my_field_name']) && ! empty($_POST['_my_field_name']) ) + $order->update_meta_data( '_my_field_name', sanitize_text_field( $_POST['_my_field_name'] ) ); + + + $subscribe = filter_var($_POST['mailjet_woo_subscribe_ok'], FILTER_SANITIZE_NUMBER_INT); + if ($subscribe) { + $order->update_meta_data( 'mailjet_woo_subscribe_ok', sanitize_text_field( $_POST['mailjet_woo_subscribe_ok'] ) ); + $this->mailjet_subscribe_confirmation_from_woo_form($subscribe, $wooUserEmail, $firstName, $lastName); + } + } + + + /** + * Subscribe or unsubscribe a wordpress comment author in/from a Mailjet's contact list when the comment is saved + */ + public function mailjet_subscribe_unsub_woo_to_list($subscribe, $user_email, $first_name, $last_name) + { + $action = intval($subscribe) === 1 ? 'addforce' : 'remove'; + $contactproperties = []; + if (!empty($first_name)) { + MailjetApi::createMailjetContactProperty('firstname'); + $contactproperties['firstname'] = $first_name; + } + if (!empty($last_name)) { + MailjetApi::createMailjetContactProperty('lastname'); + $contactproperties['lastname'] = $last_name; + } + + // Add the user to a contact list + return SubscriptionOptionsSettings::syncSingleContactEmailToMailjetList(get_option('mailjet_woo_list'), $user_email, $action, $contactproperties); + } + + + + + /** + * Email the collected widget data to the customer with a verification token + * @param void + * @return void + */ + public function mailjet_subscribe_confirmation_from_woo_form($subscribe, $user_email, $first_name, $last_name) + { + $error = empty($user_email) ? 'Email field is empty' : false; + if (false !== $error) { + _e($error, 'mailjet'); + die; + } + + if (!is_email($user_email)) { + _e('Invalid email', 'mailjet'); + die; + } + $wpUrl = sprintf('%s', get_home_url(), get_home_url()); + + $message = file_get_contents(dirname(dirname(dirname(__FILE__))) . '/templates/confirm-subscription-email.php'); + $emailParams = array( + '__EMAIL_TITLE__' => __('Please confirm your subscription', 'mailjet'), + '__EMAIL_HEADER__' => sprintf(__('To receive newsletters from %s please confirm your subscription by clicking the following button:', 'mailjet'), $wpUrl), + '__WP_URL__' => $wpUrl, + '__CONFIRM_URL__' => get_home_url() . '?subscribe=' . $subscribe . '&user_email=' . $user_email . '&first_name=' . $first_name . '&last_name=' . $last_name . '&mj_sub_woo_token=' . sha1($subscribe . $user_email . $first_name . $last_name), + '__CLICK_HERE__' => __('Yes, subscribe me to this list', 'mailjet'), + '__FROM_NAME__' => get_option('blogname'), + '__IGNORE__' => __('If you received this email by mistake or don\'t wish to subscribe anymore, simply ignore this message.', 'mailjet'), + ); + foreach ($emailParams as $key => $value) { + $message = str_replace($key, $value, $message); + } + + $email_subject = __('Subscription Confirmation', 'mailjet'); + add_filter('wp_mail_content_type', array(new SubscriptionOptionsSettings(), 'set_html_content_type')); + $res = wp_mail($user_email, $email_subject, $message, + array('From: ' . get_option('blogname') . ' <' . get_option('admin_email') . '>')); + } + + + /** + * Function to change the "Thank you" text for WooCommerce order processed page - to add message that user has received subscription confirmation email + * + * @param $str + * @param $order + * @return string + */ + public function woo_change_order_received_text($str, $order) + { + if (!empty($order)) { + if ('1' == get_post_meta($order->get_id(), 'mailjet_woo_subscribe_ok', true )) { + $str .= '

    We have sent the newsletter subscription confirmation link to you (' . $order->get_billing_email() . '). To confirm your subscription you have to click on the provided link.'; + } + } + return $str; + } + +} diff --git a/src/includes/index.php b/src/includes/index.php new file mode 100644 index 00000000..e71af0ef --- /dev/null +++ b/src/includes/index.php @@ -0,0 +1 @@ + + + + Subscription + + + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    confirm subscription
    +
    +
    +
    + +
    +
    +
    +
    +

    + + + + \ No newline at end of file diff --git a/src/widget/WP_Mailjet_Subscribe_Widget.php b/src/widget/WP_Mailjet_Subscribe_Widget.php new file mode 100644 index 00000000..bc52caa8 --- /dev/null +++ b/src/widget/WP_Mailjet_Subscribe_Widget.php @@ -0,0 +1,981 @@ + 'WP_Mailjet_Subscribe_Widget', + 'description' => __('Allows your visitors to subscribe to one of your lists', $this->get_widget_slug()) + ); + parent::__construct( + $this->get_widget_slug(), __('Mailjet Subscription Widget', $this->get_widget_slug()), $widget_options + ); + + // Register site styles and scripts + add_action('admin_print_styles', array($this, 'register_widget_styles')); + add_action('admin_enqueue_scripts', array($this, 'register_widget_scripts')); + add_action('admin_enqueue_scripts', array($this, 'register_widget_styles')); + add_action('admin_enqueue_scripts', array($this, 'register_widget_scripts')); + + // Refreshing the widget's cached output with each new post + add_action('save_post', array($this, 'flush_widget_cache')); + add_action('deleted_post', array($this, 'flush_widget_cache')); + add_action('switch_theme', array($this, 'flush_widget_cache')); + + add_action('wp_ajax_mailjet_add_contact_property', array($this, 'wp_ajax_mailjet_add_contact_property')); + + // Subscribe user + $this->activateConfirmSubscriptionUrl(); + } + +// end constructor + + /** + * Return the widget slug. + * + * @since 5.0.0 + * + * @return Plugin slug variable. + */ + public function get_widget_slug() + { + return $this->widget_slug; + } + + /** + * Check if subscription form is submited + * Check if the user is already subscribed + * Send subscription email if need + * @param SubscriptionOptionsSettings $subscriptionOptionsSettings + * @return boolean + */ + private function sendSubscriptionEmail($subscriptionOptionsSettings, $instance) + { + $locale = Mailjeti18n::getLocale(); + // Check if subscription form is submited + if (!isset($_POST['subscription_email'])) { + // Subscription form is not submited + return false; + } + + $subscription_locale = $locale; + if (isset($_POST['subscription_locale'])) { + $subscription_locale = $_POST['subscription_locale']; + } + + // Submited but empty + if (empty($_POST['subscription_email'])) { + return !empty($instance[$locale]['empty_email_message_input']) ? $instance[$locale]['empty_email_message_input'] : Mailjeti18n::getTranslationsFromFile($locale, 'Please provide an email address'); + } + + // Send subscription email + $subscription_email = $_POST['subscription_email']; + if (!is_email($subscription_email)) { + return Mailjeti18n::getTranslationsFromFile($locale, 'Invalid email'); + } + + $properties = isset($_POST['properties']) ? $_POST['properties'] : array(); + $mailjetContactProperties = $this->getMailjetContactProperties(); + $incorectTypeValue = !empty($instance[$locale]['invalid_data_format_message_input']) ? $instance[$locale]['invalid_data_format_message_input'] : Mailjeti18n::getTranslationsFromFile($locale, 'The value you entered is not in the correct format.'); + + if(!empty($properties) && is_array($mailjetContactProperties) && !empty($mailjetContactProperties)) { + foreach($properties as $propertyId => $propertyName) { + if($propertyName == '') { + continue; + } + foreach($mailjetContactProperties as $mailjetContactProperty) { + if($propertyId == $mailjetContactProperty['ID']) { + $dataType = $mailjetContactProperty['Datatype']; + switch($dataType) { + case "str": + // by default + break; + case "int": + $propertyNameCopy = $propertyName; + $intProperty = (int) $propertyNameCopy; + if ($intProperty == 0 && $propertyName !== "0") { + return $incorectTypeValue; + } + break; + case "float": + $propertyNameCopy = $propertyName; + $fProperty = (float) $propertyNameCopy; + if(!is_float($fProperty) || $fProperty == 0) { + return $incorectTypeValue; + } + if ($fProperty == 0 && $propertyName !== "0") { + return $incorectTypeValue; + } + break; + case "datetime": + $propertyDate = str_replace('-', '/', $properties[$propertyId]); + $datetime = \DateTime::createFromFormat("d/m/Y", $propertyDate); + $errors = \DateTime::getLastErrors(); + if (!$datetime instanceof \DateTime) { + return $incorectTypeValue; + } + if (!empty($errors['warning_count'])) { + return $incorectTypeValue; + } + break; + case "bool": + $booleans = array('true', 'false', '1', '0','yes', 'no', 'ok'); + if(!in_array($propertyName, $booleans)) { + return $incorectTypeValue; + } + break; + } + continue; + } + } + } + } + + $sendingResult = $subscriptionOptionsSettings->mailjet_subscribe_confirmation_from_widget($subscription_email, $instance, $subscription_locale); + if ($sendingResult) { + return !empty($instance[$locale]['confirmation_email_message_input']) ? $instance[$locale]['confirmation_email_message_input'] : Mailjeti18n::getTranslationsFromFile($locale, 'Subscription confirmation email sent. Please check your inbox and confirm the subscription.'); + } + return !empty($instance[$locale]['technical_error_message_input']) ? $instance[$locale]['technical_error_message_input'] : Mailjeti18n::getTranslationsFromFile($locale, 'A technical issue has prevented your subscription. Please try again later.'); + } + + /** + * Validete the confirmation link + * Subscribe to mailjet list + * @param type $subscriptionOptionsSettings + */ + private function activateConfirmSubscriptionUrl() + { + $locale = Mailjeti18n::getLocale(); + $subscriptionOptionsSettings = $this->getSubscriptionOptionsSettings(); + + // Check if subscription email is confirmed + if (empty($_GET['mj_sub_token'])) { + return true; + } + + if (!empty($_GET['subscription_locale'])) { + $locale = $_GET['subscription_locale']; + } + + $technicalIssue = Mailjeti18n::getTranslationsFromFile($locale, 'A technical issue has prevented your subscription. Please try again later.'); + + $subscription_email = isset($_GET['subscription_email']) ? $_GET['subscription_email'] : ''; + if (!$subscription_email) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Subscription email is missing ]'); + echo $technicalIssue; + die; + } + + $properties = isset($_GET['properties']) ? $_GET['properties'] : array(); + $params = http_build_query(array( + 'subscription_email' => $subscription_email, + 'subscription_locale' => $locale, + 'properties' => $properties, + )); + + // The token is valid we can subscribe the user + if ($_GET['mj_sub_token'] == sha1($params . $subscriptionOptionsSettings::WIDGET_HASH)) { + + $contactListId = get_option('mailjet_locale_subscription_list_' . $locale); + + // List id is not provided + if (!$contactListId) { + // Use en_US list id as default + $listIdEn = get_option('mailjet_locale_subscription_list_en_US'); + if (!$listIdEn) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ ContactList ID is not provided for ' . $locale . '! ]'); + die; + } + $contactListId = $listIdEn; + } + + $dataProperties = array(); + $mailjetContactProperties = $this->getMailjetContactProperties(); + if (!empty($mailjetContactProperties)) { + foreach ($mailjetContactProperties as $property) { + if (isset($properties[$property['ID']]) && $properties[$property['ID']] != '' ) { + $dataType = $property['Datatype']; + switch ($dataType) { + case "datetime": + $datetime = \DateTime::createFromFormat("d/m/Y", $properties[$property['ID']]); + if ($datetime instanceof \DateTime) { + $dataProperties[$property['Name']] = $datetime->format(\DateTime::RFC3339); + } + break; + case "int": + $dataProperties[$property['Name']] = (int)$properties[$property['ID']]; + break; + case "float": + $dataProperties[$property['Name']] = (float)$properties[$property['ID']]; + break; + case "bool": + $positiveBooleans = array('true', '1', 'yes', 'ok'); + if(in_array($properties[$property['ID']], $positiveBooleans)) { + $dataProperties[$property['Name']] = true; + }else{ + $dataProperties[$property['Name']] = false; + } + break; + case "str": + default: + $dataProperties[$property['Name']] = $properties[$property['ID']]; + break; + } + } + } + } + + $contact = array( + 'Email' => $subscription_email, +// 'Name' => $contactProperties['first_name'] . ' ' . $contactProperties['last_name'], + 'Properties' => $dataProperties + ); + + $isActiveList = MailjetApi::isContactListActive($contactListId); + if (!$isActiveList) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ ContactList: ' . $contactListId . ' is deleted and ' . $subscription_email . ' was not subscribed ]'); + echo $technicalIssue; + die; + } + + $result = MailjetApi::syncMailjetContact($contactListId, $contact); + if (!$result) { + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ Subscription failed ]'); + echo $technicalIssue; + die; + } + + // Subscribed + $language = Mailjeti18n::getCurrentUserLanguage(); + $thankYouPageId = get_option('mailjet_thank_you_page_' . $language); + + // If no selected page, select default template + if (!$thankYouPageId) { +// $locale = Mailjeti18n::getLocaleByPll(); + $newsletterRegistration = Mailjeti18n::getTranslationsFromFile($locale, 'Newsletter Registration'); + $congratsSubscribed = Mailjeti18n::getTranslationsFromFile($locale, 'Congratulations, you have successfully subscribed!'); + + $tankyouPageTemplate = apply_filters('mailjet_thank_you_page_template', plugin_dir_path(__FILE__) . 'templates' . DIRECTORY_SEPARATOR . 'thankyou.php'); + // Default page is selected + include($tankyouPageTemplate); + die; + } + } else { + // Invalid token + MailjetLogger::error('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ User token is invalid.Subscription email ' . $subscription_email . ']'); + echo $technicalIssue; + die; + } + } + + /* -------------------------------------------------- */ + /* Widget API Functions + /*-------------------------------------------------- */ + + /** + * Outputs the content of the widget. + * + * @param array args The array of form elements + * @param array instance The current instance of the widget + */ + public function widget($args, $instance) + { + $mailjetContactProperties = $this->getMailjetContactProperties(); + if (!empty($mailjetContactProperties) && is_array($mailjetContactProperties)) { + foreach ($mailjetContactProperties as $mjContactProperty) { + $this->propertyData[$mjContactProperty['ID']] = array( + 'Name' => $mjContactProperty['Name'], + 'Datatype' => $mjContactProperty['Datatype'] + ); + } + } + $subscriptionOptionsSettings = $this->getSubscriptionOptionsSettings(); + + // Send subscription email if need + $form_message = $this->sendSubscriptionEmail($subscriptionOptionsSettings, $instance); + + // Subscribe user +// $this->activateConfirmSubscriptionUrl(); + // Check if there is a cached output + $cache = wp_cache_get($this->get_widget_slug(), 'widget'); + + if (!is_array($cache)) { + $cache = array(); + } + + if (!isset($args['widget_id'])) { + $args['widget_id'] = $this->id; + } + + if (isset($cache[$args['widget_id']])) { + return print $cache[$args['widget_id']]; + } + + // Show front widget form + // go on with your widget logic, put everything into a string and … + extract($args, EXTR_SKIP); + + $widget_string = $before_widget; + + ob_start(); + $front_widget_file = apply_filters('mailjet_widget_form_filename', plugin_dir_path(__FILE__) . 'views/widget.php'); + include($front_widget_file); + $widget_string .= ob_get_clean(); + $widget_string .= $after_widget; + + $cache[$args['widget_id']] = $widget_string; + + wp_cache_set($this->get_widget_slug(), $cache, 'widget'); + print $widget_string; + } + + private function getInputType($inputType) + { + switch ($inputType) { + case 'str': + $inputType = 'text'; + break; + case 'int': + $inputType = 'number'; + break; + case 'datetime': + $inputType = 'date'; + break; + case 'float': + case 'bool': + $inputType = 'text'; + break; + default: + $inputType = 'text'; + break; + } + return $inputType; + } + + public function flush_widget_cache() + { + wp_cache_delete($this->get_widget_slug(), 'widget'); + } + + /** + * Processes the widget's options to be saved. + * + * @param array new_instance The new instance of values to be generated via the update. + * @param array old_instance The previous instance of values before the update. + */ + public function update($new_instance, $old_instance) + { + // Here is where you update your widget's old values with the new, incoming values + $instance = $old_instance; + + $languages = Mailjeti18n::getSupportedLocales(); + $admin_locale = Mailjeti18n::getLocale(); + +// echo "
    ";
    +//        print_r($admin_locale);
    +//        echo "
    ";exit; + + foreach ($languages as $language => $locale) { + // Do not save if language is active but there is no contact list chosen for it + if (isset($new_instance[$locale]['language_checkbox']) && $new_instance[$locale]['list'] == "0") { + continue; + } + + // Initial + $instance[$locale]['language_checkbox'] = isset($new_instance[$locale]['language_checkbox']) ? 1 : false; + $instance[$locale]['title'] = isset($new_instance[$locale]['title']) ? wp_strip_all_tags($new_instance[$locale]['title']) : ''; + $instance[$locale]['list'] = isset($new_instance[$locale]['list']) ? wp_strip_all_tags($new_instance[$locale]['list']) : ''; + update_option('mailjet_locale_subscription_list_' . $locale, $instance[$locale]['list']); + + // Tab 1 + $instance[$locale]['language_mandatory_email'] = isset($new_instance[$locale]['language_mandatory_email']) ? wp_strip_all_tags($new_instance[$locale]['language_mandatory_email']) : ''; +// $buttonLabel = isset($new_instance[$locale]['language_mandatory_button']) ? apply_filters('widget_title', $new_instance[$locale]['language_mandatory_button']) : ''; +// $instance[$locale]['language_mandatory_button'] = isset($new_instance[$locale]['language_mandatory_button']) ? wp_strip_all_tags($new_instance[$locale]['language_mandatory_button']) : $buttonLabel; + $instance[$locale]['language_mandatory_button'] = isset($new_instance[$locale]['language_mandatory_button']) ? wp_strip_all_tags($new_instance[$locale]['language_mandatory_button']) : ''; + + for ($i = 0; $i <= 4; $i++) { + $instance[$locale]['contactProperties' . $i] = isset($new_instance[$admin_locale]['contactProperties' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['contactProperties' . $i]) : ''; + $instance[$locale]['propertyDataType' . $i] = isset($new_instance[$admin_locale]['propertyDataType' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['propertyDataType' . $i]) : ''; + +// $instance[$locale][$language.'Label'.$i] = isset($new_instance[$locale][$language.'Label'.$i]) ? wp_strip_all_tags($new_instance[$locale][$language.'Label'.$i]) : ''; + $instance[$locale]['EnglishLabel' . $i] = isset($new_instance[$admin_locale]['EnglishLabel' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['EnglishLabel' . $i]) : ''; + $instance[$locale]['FrenchLabel' . $i] = isset($new_instance[$admin_locale]['FrenchLabel' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['FrenchLabel' . $i]) : ''; + $instance[$locale]['GermanLabel' . $i] = isset($new_instance[$admin_locale]['GermanLabel' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['GermanLabel' . $i]) : ''; + $instance[$locale]['SpanishLabel' . $i] = isset($new_instance[$admin_locale]['SpanishLabel' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['SpanishLabel' . $i]) : ''; + $instance[$locale]['ItalianLabel' . $i] = isset($new_instance[$admin_locale]['ItalianLabel' . $i]) ? wp_strip_all_tags($new_instance[$admin_locale]['ItalianLabel' . $i]) : ''; + } + + // Tab 2 + $instance[$locale]['confirmation_email_message_input'] = isset($new_instance[$locale]['confirmation_email_message_input']) ? wp_strip_all_tags($new_instance[$locale]['confirmation_email_message_input']) : ''; + $instance[$locale]['subscription_confirmed_message_input'] = isset($new_instance[$locale]['subscription_confirmed_message_input']) ? wp_strip_all_tags($new_instance[$locale]['subscription_confirmed_message_input']) : ''; + $instance[$locale]['empty_email_message_input'] = isset($new_instance[$locale]['empty_email_message_input']) ? wp_strip_all_tags($new_instance[$locale]['empty_email_message_input']) : ''; + $instance[$locale]['already_subscribed_message_input'] = isset($new_instance[$locale]['already_subscribed_message_input']) ? wp_strip_all_tags($new_instance[$locale]['already_subscribed_message_input']) : ''; + $instance[$locale]['invalid_data_format_message_input'] = isset($new_instance[$locale]['invalid_data_format_message_input']) ? wp_strip_all_tags($new_instance[$locale]['invalid_data_format_message_input']) : ''; + $instance[$locale]['generic_technical_error_message_input'] = isset($new_instance[$locale]['generic_technical_error_message_input']) ? wp_strip_all_tags($new_instance[$locale]['generic_technical_error_message_input']) : ''; + + // Tab 3 + $instance[$locale]['email_subject'] = isset($new_instance[$locale]['email_subject']) ? wp_strip_all_tags($new_instance[$locale]['email_subject']) : ''; + $instance[$locale]['email_content_title'] = isset($new_instance[$locale]['email_content_title']) ? wp_strip_all_tags($new_instance[$locale]['email_content_title']) : ''; + $instance[$locale]['email_content_main_text'] = isset($new_instance[$locale]['email_content_main_text']) ? wp_strip_all_tags($new_instance[$locale]['email_content_main_text']) : ''; + $instance[$locale]['email_content_confirm_button'] = isset($new_instance[$locale]['email_content_confirm_button']) ? wp_strip_all_tags($new_instance[$locale]['email_content_confirm_button']) : ''; + $instance[$locale]['email_content_after_button'] = isset($new_instance[$locale]['email_content_after_button']) ? wp_strip_all_tags($new_instance[$locale]['email_content_after_button']) : ''; + + // Tab 4 + $instance[$language]['thank_you'] = isset($new_instance[$language]['thank_you']) ? wp_strip_all_tags($new_instance[$language]['thank_you']) : 0; + update_option('mailjet_thank_you_page_' . $language, $instance[$language]['thank_you']); + + // Translations update + Mailjeti18n::updateTranslationsInFile($locale, $instance[$locale]); + } + $this->instance = $instance; +// echo "
    ";
    +//        print_r($instance);
    +//        echo "
    ";exit; + return $instance; + } + + /** + * Register the dynamic translations to the po files + */ + private function registerCustomLanguageTranslations() + { + __('English', 'wp-mailjet'); + __('French', 'wp-mailjet'); + __('German', 'wp-mailjet'); + __('Spanish', 'wp-mailjet'); + __('Italian', 'wp-mailjet'); + __('your@email.com', 'wp-mailjet'); + __('Subscribe', 'wp-mailjet'); + __('Subscription confirmation email sent. Please check your inbox and confirm your subscription.', 'wp-mailjet'); + __('Your subscription was successfully confirmed.', 'wp-mailjet'); + __('Please provide an email address', 'wp-mailjet'); + __('Please confirm your subscription', 'wp-mailjet'); + __('This email address has already been subscribed.', 'wp-mailjet'); + __('The value you entered is not in the correct format.', 'wp-mailjet'); + __('A technical issue has prevented your subscription. Please try again later.', 'wp-mailjet'); + __('Yes, subscribe me to this list', 'wp-mailjet'); + __("If you received this email by mistake or don't wish to subscribe anymore, simply ignore this message", 'wp-mailjet'); + } + + /** + * Transition widget settings from v4 to v5 + */ + private function checkTransition($instance) + { + if (isset($instance['enableTaben']) && $instance['enableTaben'] == 'on') { + $contactProperties0name = isset($instance['metaPropertyName1en']) ? $instance['metaPropertyName1en'] : false; // -> contactProperties0 + $contactProperties1name = isset($instance['metaPropertyName2en']) ? $instance['metaPropertyName2en'] : false; // -> contactProperties1 + $contactProperties2name = isset($instance['metaPropertyName3en']) ? $instance['metaPropertyName3en'] : false; // -> contactProperties2 + $property0Id = MailjetApi::getPropertyIdByName($contactProperties0name); + $property1Id = MailjetApi::getPropertyIdByName($contactProperties1name); + $property2Id = MailjetApi::getPropertyIdByName($contactProperties2name); + + $titleEn = isset($instance['titleen']) ? $instance['titleen'] : ''; + $listEn = isset($instance['list_iden']) ? $instance['list_iden'] : ''; + $property0En = isset($instance['metaProperty1en']) ? $instance['metaProperty1en'] : ''; + $property1En = isset($instance['metaProperty2en']) ? $instance['metaProperty2en'] : ''; + $property2En = isset($instance['metaProperty3en']) ? $instance['metaProperty3en'] : ''; + $buttonТextЕn = isset($instance['button_texten']) ? $instance['button_texten'] : ''; + + $enableFr = isset($instance['enableTabfr']) && $instance['enableTabfr'] == 'on'; + $titleFr = isset($instance['titlefr']) ? $instance['titlefr'] : ''; + $listFr = isset($instance['list_idfr']) ? $instance['list_idfr'] : ''; + $property0Fr = isset($instance['metaProperty1fr']) ? $instance['metaProperty1fr'] : ''; + $property1Fr = isset($instance['metaProperty2fr']) ? $instance['metaProperty2fr'] : ''; + $property2Fr = isset($instance['metaProperty3fr']) ? $instance['metaProperty3fr'] : ''; + $buttonТextFr = isset($instance['button_textfr']) ? $instance['button_textfr'] : ''; + + $enableDe = isset($instance['enableTabde']) && $instance['enableTabde'] == 'on'; + $titleDe = isset($instance['titlede']) ? $instance['titlede'] : ''; + $listDe = isset($instance['list_idde']) ? $instance['list_idde'] : ''; + $property0De = isset($instance['metaProperty1de']) ? $instance['metaProperty1de'] : ''; + $property1De = isset($instance['metaProperty2de']) ? $instance['metaProperty2de'] : ''; + $property2De = isset($instance['metaProperty3de']) ? $instance['metaProperty3de'] : ''; + $buttonТextDe = isset($instance['button_textde']) ? $instance['button_textde'] : ''; + + $enableEs = isset($instance['enableTabes']) && $instance['enableTabes'] == 'on'; + $titleEs = isset($instance['titlees']) ? $instance['titlees'] : ''; + $listEs = isset($instance['list_ides']) ? $instance['list_ides'] : ''; + $property0Es = isset($instance['metaProperty1es']) ? $instance['metaProperty1es'] : ''; + $property1Es = isset($instance['metaProperty2es']) ? $instance['metaProperty2es'] : ''; + $property2Es = isset($instance['metaProperty3es']) ? $instance['metaProperty3es'] : ''; + $buttonТextЕs = isset($instance['button_textes']) ? $instance['button_textes'] : ''; + + $data = array( + 'en_US' => + array( + 'language_checkbox' => true, + 'title' => $titleEn, + 'list' => $listEn, + 'language_mandatory_email' => '', + 'language_mandatory_button' => $buttonТextЕn, + 'contactProperties0' => $property0Id, + 'propertyDataType0' => '0', + 'EnglishLabel0' => $property0En, + 'FrenchLabel0' => $property0Fr, + 'GermanLabel0' => $property0De, + 'SpanishLabel0' => $property0Es, + 'ItalianLabel0' => '', + 'contactProperties1' => $property1Id, + 'propertyDataType1' => '0', + 'EnglishLabel1' => $property1En, + 'FrenchLabel1' => $property1Fr, + 'GermanLabel1' => $property1De, + 'SpanishLabel1' => $property1Es, + 'ItalianLabel1' => '', + 'contactProperties2' => $property2Id, + 'propertyDataType2' => '0', + 'EnglishLabel2' => $property2En, + 'FrenchLabel2' => $property2Fr, + 'GermanLabel2' => $property2De, + 'SpanishLabel2' => $property2Es, + 'ItalianLabel2' => '', + 'contactProperties3' => '', + 'propertyDataType3' => '0', + 'EnglishLabel3' => '', + 'FrenchLabel3' => '', + 'GermanLabel3' => '', + 'SpanishLabel3' => '', + 'ItalianLabel3' => '', + 'contactProperties4' => '', + 'propertyDataType4' => '0', + 'EnglishLabel4' => '', + 'FrenchLabel4' => '', + 'GermanLabel4' => '', + 'SpanishLabel4' => '', + 'ItalianLabel4' => '', + 'confirmation_email_message_input' => '', + 'subscription_confirmed_message_input' => '', + 'empty_email_message_input' => '', + 'already_subscribed_message_input' => '', + 'invalid_data_format_message_input' => '', + 'generic_technical_error_message_input' => '', + 'email_subject' => '', + 'email_content_title' => '', + 'email_content_main_text' => '', + 'email_content_confirm_button' => '', + 'email_content_after_button' => '', + ), + 'English' => + array( + 'thank_you' => 0, + ), + 'fr_FR' => + array( + 'language_checkbox' => $enableFr, + 'title' => $titleFr, + 'list' => $listFr, + 'language_mandatory_email' => '', + 'language_mandatory_button' => $buttonТextFr, + 'contactProperties0' => $property0Id, + 'propertyDataType0' => '0', + 'EnglishLabel0' => $property0En, + 'FrenchLabel0' => $property0Fr, + 'GermanLabel0' => $property0De, + 'SpanishLabel0' => $property0Es, + 'ItalianLabel0' => '', + 'contactProperties1' => $property1Id, + 'propertyDataType1' => '0', + 'EnglishLabel1' => $property1En, + 'FrenchLabel1' => $property1Fr, + 'GermanLabel1' => $property1Fr, + 'SpanishLabel1' => $property1Fr, + 'ItalianLabel1' => '', + 'contactProperties2' => $property2Id, + 'propertyDataType2' => '0', + 'EnglishLabel2' => $property2En, + 'FrenchLabel2' => $property2Fr, + 'GermanLabel2' => $property2De, + 'SpanishLabel2' => $property2Es, + 'ItalianLabel2' => '', + 'contactProperties3' => '', + 'propertyDataType3' => '', + 'EnglishLabel3' => '', + 'FrenchLabel3' => '', + 'GermanLabel3' => '', + 'SpanishLabel3' => '', + 'ItalianLabel3' => '', + 'contactProperties4' => '', + 'propertyDataType4' => '', + 'EnglishLabel4' => '', + 'FrenchLabel4' => '', + 'GermanLabel4' => '', + 'SpanishLabel4' => '', + 'ItalianLabel4' => '', + 'confirmation_email_message_input' => '', + 'subscription_confirmed_message_input' => '', + 'empty_email_message_input' => '', + 'already_subscribed_message_input' => '', + 'invalid_data_format_message_input' => '', + 'generic_technical_error_message_input' => '', + 'email_subject' => '', + 'email_content_title' => '', + 'email_content_main_text' => '', + 'email_content_confirm_button' => '', + 'email_content_after_button' => '', + ), + 'French' => + array( + 'thank_you' => 0, + ), + 'de_DE' => + array( + 'language_checkbox' => $enableDe, + 'title' => $titleDe, + 'list' => $listDe, + 'language_mandatory_email' => '', + 'language_mandatory_button' => $buttonТextDe, + 'contactProperties0' => $property0Id, + 'propertyDataType0' => '0', + 'EnglishLabel0' => $property0En, + 'FrenchLabel0' => $property0Fr, + 'GermanLabel0' => $property0De, + 'SpanishLabel0' => $property0Es, + 'ItalianLabel0' => '', + 'contactProperties1' => $property1Id, + 'propertyDataType1' => '0', + 'EnglishLabel1' => $property1En, + 'FrenchLabel1' => $property1Fr, + 'GermanLabel1' => $property1Fr, + 'SpanishLabel1' => $property1Fr, + 'ItalianLabel1' => '', + 'contactProperties2' => $property2Id, + 'propertyDataType2' => '0', + 'EnglishLabel2' => $property2En, + 'FrenchLabel2' => $property2Fr, + 'GermanLabel2' => $property2De, + 'SpanishLabel2' => $property2Es, + 'ItalianLabel2' => '', + 'contactProperties3' => '', + 'propertyDataType3' => '', + 'EnglishLabel3' => '', + 'FrenchLabel3' => '', + 'GermanLabel3' => '', + 'SpanishLabel3' => '', + 'ItalianLabel3' => '', + 'contactProperties4' => '', + 'propertyDataType4' => '', + 'EnglishLabel4' => '', + 'FrenchLabel4' => '', + 'GermanLabel4' => '', + 'SpanishLabel4' => '', + 'ItalianLabel4' => '', + 'confirmation_email_message_input' => '', + 'subscription_confirmed_message_input' => '', + 'empty_email_message_input' => '', + 'already_subscribed_message_input' => '', + 'invalid_data_format_message_input' => '', + 'generic_technical_error_message_input' => '', + 'email_subject' => '', + 'email_content_title' => '', + 'email_content_main_text' => '', + 'email_content_confirm_button' => '', + 'email_content_after_button' => '', + ), + 'German' => + array( + 'thank_you' => 0, + ), + 'es_ES' => + array( + 'language_checkbox' => $enableEs, + 'title' => $titleEs, + 'list' => $listEs, + 'language_mandatory_email' => '', + 'language_mandatory_button' => $buttonТextЕs, + 'contactProperties0' => $property0Id, + 'propertyDataType0' => '0', + 'EnglishLabel0' => $property0En, + 'FrenchLabel0' => $property0Fr, + 'GermanLabel0' => $property0De, + 'SpanishLabel0' => $property0Es, + 'ItalianLabel0' => '', + 'contactProperties1' => $property1Id, + 'propertyDataType1' => '0', + 'EnglishLabel1' => $property1En, + 'FrenchLabel1' => $property1Fr, + 'GermanLabel1' => $property1Fr, + 'SpanishLabel1' => $property1Fr, + 'ItalianLabel1' => '', + 'contactProperties2' => $property2Id, + 'propertyDataType2' => '0', + 'EnglishLabel2' => $property2En, + 'FrenchLabel2' => $property2Fr, + 'GermanLabel2' => $property2De, + 'SpanishLabel2' => $property2Es, + 'ItalianLabel2' => '', + 'contactProperties3' => '', + 'propertyDataType3' => '', + 'EnglishLabel3' => '', + 'FrenchLabel3' => '', + 'GermanLabel3' => '', + 'SpanishLabel3' => '', + 'ItalianLabel3' => '', + 'contactProperties4' => '', + 'propertyDataType4' => '', + 'EnglishLabel4' => '', + 'FrenchLabel4' => '', + 'GermanLabel4' => '', + 'SpanishLabel4' => '', + 'ItalianLabel4' => '', + 'confirmation_email_message_input' => '', + 'subscription_confirmed_message_input' => '', + 'empty_email_message_input' => '', + 'already_subscribed_message_input' => '', + 'invalid_data_format_message_input' => '', + 'generic_technical_error_message_input' => '', + 'email_subject' => '', + 'email_content_title' => '', + 'email_content_main_text' => '', + 'email_content_confirm_button' => '', + 'email_content_after_button' => '', + ), + 'Spanish' => + array( + 'thank_you' => 0, + ), + 'it_IT' => + array( + 'language_checkbox' => false, + 'title' => '', + 'list' => '0', + 'language_mandatory_email' => '', + 'language_mandatory_button' => '', + 'contactProperties0' => '', + 'propertyDataType0' => '', + 'EnglishLabel0' => '', + 'FrenchLabel0' => '', + 'GermanLabel0' => '', + 'SpanishLabel0' => '', + 'ItalianLabel0' => '', + 'contactProperties1' => '', + 'propertyDataType1' => '', + 'EnglishLabel1' => '', + 'FrenchLabel1' => '', + 'GermanLabel1' => '', + 'SpanishLabel1' => '', + 'ItalianLabel1' => '', + 'contactProperties2' => '', + 'propertyDataType2' => '', + 'EnglishLabel2' => '', + 'FrenchLabel2' => '', + 'GermanLabel2' => '', + 'SpanishLabel2' => '', + 'ItalianLabel2' => '', + 'contactProperties3' => '', + 'propertyDataType3' => '', + 'EnglishLabel3' => '', + 'FrenchLabel3' => '', + 'GermanLabel3' => '', + 'SpanishLabel3' => '', + 'ItalianLabel3' => '', + 'contactProperties4' => '', + 'propertyDataType4' => '', + 'EnglishLabel4' => '', + 'FrenchLabel4' => '', + 'GermanLabel4' => '', + 'SpanishLabel4' => '', + 'ItalianLabel4' => '', + 'confirmation_email_message_input' => '', + 'subscription_confirmed_message_input' => '', + 'empty_email_message_input' => '', + 'already_subscribed_message_input' => '', + 'invalid_data_format_message_input' => '', + 'generic_technical_error_message_input' => '', + 'email_subject' => '', + 'email_content_title' => '', + 'email_content_main_text' => '', + 'email_content_confirm_button' => '', + 'email_content_after_button' => '', + ), + 'Italian' => + array( + 'thank_you' => 0, + ) + ); + + update_option('widget_wp_mailjet_subscribe_widget', $data); + $instance = get_option('widget_wp_mailjet_subscribe_widget'); + } + return $instance; + } + + /** + * Generates the administration form for the widget. + * + * @param array instance The array of keys and values for the widget. + */ + public function form($instance) + { + wp_enqueue_style('mailjet_bootstrap'); + wp_enqueue_style($this->get_widget_slug() . '-widget-styles', plugins_url('css/widget.css', __FILE__), array(), MAILJET_VERSION, 'all'); + wp_enqueue_script($this->get_widget_slug() . '-script'); + wp_enqueue_script('mailjetjs_bootstrap'); + + $validApiCredentials = MailjetApi::isValidAPICredentials(); + if (false == $validApiCredentials) { + include(plugin_dir_path(__FILE__) . 'views' . DIRECTORY_SEPARATOR . 'designforfailure.php'); + return false; + } + + $instance = $this->checkTransition($instance); + + // Define default values for your variables + $instance = wp_parse_args( + (array) $instance + ); + + // Mailjet contact lists + try { + $mailjetContactLists = MailjetApi::getMailjetContactLists(); + } catch (\Exception $ex) { + include(plugin_dir_path(__FILE__) . 'views' . DIRECTORY_SEPARATOR . 'designforfailure.php'); + return false; + } + + $contactLists = !empty($mailjetContactLists) ? $mailjetContactLists : array(); + $mailjetContactProperties = $this->getMailjetContactProperties(); + + $propertiesOptions = array(); + if (!empty($mailjetContactProperties)) { + foreach ($mailjetContactProperties as $property) { + $propertiesOptions[$property['ID']] = $property['Name']; + } + } + + // Mailjet is down (widget can't be configured so show an error instead of form) + if ($mailjetContactLists === false && $mailjetContactProperties === false) { + $isMailjetDown = 'No connection with Mailjet.Please try a bit later.'; + } + + $mailjetContactProperties = null; + $mailjetContactProperties = $propertiesOptions; +// $admin_locale = get_locale(); + $admin_locale = Mailjeti18n::getLocale(); + // Display the admin form + $languages = Mailjeti18n::getSupportedLocales(); + $pages = get_pages(); + include(plugin_dir_path(__FILE__) . 'views' . DIRECTORY_SEPARATOR . 'admin.php'); + } + + /* -------------------------------------------------- */ + /* Public Functions + /*-------------------------------------------------- */ + + /** + * Loads the Widget's text domain for localization and translation. + */ + public function widget_textdomain() + { + load_plugin_textdomain('wp-mailjet', false, dirname(dirname(dirname(plugin_basename(__FILE__)))) . '/languages/'); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'mailjet\' text domain loaded ] - ' . dirname(dirname(dirname(plugin_basename(__FILE__)))) . '/languages/'); + } + +// end widget_textdomain + + /** + * Registers and enqueues widget-specific styles. + */ + public function register_widget_styles() + { +// wp_enqueue_style($this->get_widget_slug() . '-widget-styles', plugins_url('css/widget.css', __FILE__), array(), MAILJET_VERSION, 'all'); + wp_register_style('mailjet_bootstrap', plugins_url('css/bootstrap.css', __FILE__), array(), MAILJET_VERSION, 'all'); +// wp_register_style('prefix_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'); +// wp_enqueue_style('mailjet_bootstrap'); + } + + public function register_widget_front_styles() + { + wp_enqueue_style($this->get_widget_slug() . '-widget-styles', plugins_url('css/front-widget.css', __FILE__), array(), MAILJET_VERSION, 'all'); + } + +// end register_widget_styles + + /** + * Registers and enqueues widget-specific scripts. + */ + public function register_widget_scripts() + { + wp_register_script($this->get_widget_slug() . '-script', plugins_url('js/widget.js', __FILE__), array('jquery')); + wp_localize_script($this->get_widget_slug() . '-script', 'myAjax', array('ajaxurl' => admin_url('admin-ajax.php'))); +// wp_enqueue_script($this->get_widget_slug() . '-script'); + + wp_register_script('mailjetjs_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'); +// wp_enqueue_script('mailjetjs_bootstrap'); + } + +// end register_widget_scripts + + private function getMailjetContactProperties() + { + if ($this->mailjetContactProperties == null) { + try { + $this->mailjetContactProperties = MailjetApi::getContactProperties(); + } catch (Exception $ex) { + return false; + } + } + return $this->mailjetContactProperties; + } + + private function getSubscriptionOptionsSettings() + { + if ($this->subscriptionOptionsSettings == null) { + return new SubscriptionOptionsSettings; + } + return $this->subscriptionOptionsSettings; + } + + function wp_ajax_mailjet_add_contact_property() + { + if (!empty($_POST['propertyName'])) { + $type = !empty($_POST['propertyType']) ? $_POST['propertyType'] : 'str'; + echo json_encode(MailjetApi::createMailjetContactProperty($_POST['propertyName'], $type)); + } + die; + } + +} + +// end class diff --git a/src/widget/css/bootstrap.css b/src/widget/css/bootstrap.css new file mode 100644 index 00000000..3d1dfb6c --- /dev/null +++ b/src/widget/css/bootstrap.css @@ -0,0 +1,5042 @@ +/*! + * Bootstrap v3.3.6 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ + + +/*a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +}*/ + +@font-face { + font-family: 'Glyphicons Halflings'; + + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.glyphicon-cd:before { + content: "\e201"; +} +.glyphicon-save-file:before { + content: "\e202"; +} +.glyphicon-open-file:before { + content: "\e203"; +} +.glyphicon-level-up:before { + content: "\e204"; +} +.glyphicon-copy:before { + content: "\e205"; +} +.glyphicon-paste:before { + content: "\e206"; +} +.glyphicon-alert:before { + content: "\e209"; +} +.glyphicon-equalizer:before { + content: "\e210"; +} +.glyphicon-king:before { + content: "\e211"; +} +.glyphicon-queen:before { + content: "\e212"; +} +.glyphicon-pawn:before { + content: "\e213"; +} +.glyphicon-bishop:before { + content: "\e214"; +} +.glyphicon-knight:before { + content: "\e215"; +} +.glyphicon-baby-formula:before { + content: "\e216"; +} +.glyphicon-tent:before { + content: "\26fa"; +} +.glyphicon-blackboard:before { + content: "\e218"; +} +.glyphicon-bed:before { + content: "\e219"; +} +.glyphicon-apple:before { + content: "\f8ff"; +} +.glyphicon-erase:before { + content: "\e221"; +} +.glyphicon-hourglass:before { + content: "\231b"; +} +.glyphicon-lamp:before { + content: "\e223"; +} +.glyphicon-duplicate:before { + content: "\e224"; +} +.glyphicon-piggy-bank:before { + content: "\e225"; +} +.glyphicon-scissors:before { + content: "\e226"; +} +.glyphicon-bitcoin:before { + content: "\e227"; +} +.glyphicon-btc:before { + content: "\e227"; +} +.glyphicon-xbt:before { + content: "\e227"; +} +.glyphicon-yen:before { + content: "\00a5"; +} +.glyphicon-jpy:before { + content: "\00a5"; +} +.glyphicon-ruble:before { + content: "\20bd"; +} +.glyphicon-rub:before { + content: "\20bd"; +} +.glyphicon-scale:before { + content: "\e230"; +} +.glyphicon-ice-lolly:before { + content: "\e231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; +} +.glyphicon-education:before { + content: "\e233"; +} +.glyphicon-option-horizontal:before { + content: "\e234"; +} +.glyphicon-option-vertical:before { + content: "\e235"; +} +.glyphicon-menu-hamburger:before { + content: "\e236"; +} +.glyphicon-modal-window:before { + content: "\e237"; +} +.glyphicon-oil:before { + content: "\e238"; +} +.glyphicon-grain:before { + content: "\e239"; +} +.glyphicon-sunglasses:before { + content: "\e240"; +} +.glyphicon-text-size:before { + content: "\e241"; +} +.glyphicon-text-color:before { + content: "\e242"; +} +.glyphicon-text-background:before { + content: "\e243"; +} +.glyphicon-object-align-top:before { + content: "\e244"; +} +.glyphicon-object-align-bottom:before { + content: "\e245"; +} +.glyphicon-object-align-horizontal:before { + content: "\e246"; +} +.glyphicon-object-align-left:before { + content: "\e247"; +} +.glyphicon-object-align-vertical:before { + content: "\e248"; +} +.glyphicon-object-align-right:before { + content: "\e249"; +} +.glyphicon-triangle-right:before { + content: "\e250"; +} +.glyphicon-triangle-left:before { + content: "\e251"; +} +.glyphicon-triangle-bottom:before { + content: "\e252"; +} +.glyphicon-triangle-top:before { + content: "\e253"; +} +.glyphicon-console:before { + content: "\e254"; +} +.glyphicon-superscript:before { + content: "\e255"; +} +.glyphicon-subscript:before { + content: "\e256"; +} +.glyphicon-menu-left:before { + content: "\e257"; +} +.glyphicon-menu-right:before { + content: "\e258"; +} +.glyphicon-menu-down:before { + content: "\e259"; +} +.glyphicon-menu-up:before { + content: "\e260"; +} +.mj-select-wrapper { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.mj-select-wrapper:before, +.mj-select-wrapper:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.row { + margin-right: -15px; + margin-left: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0; + } +} + +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + /*border: 1px solid #ccc;*/ + /*border-radius: 4px;*/ + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); +} +.form-control::-moz-placeholder { + color: #999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999; +} +.form-control::-webkit-input-placeholder { + color: #999; +} +.form-control::-ms-expand { + background-color: transparent; + border: 0; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #eee; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +/*input[type="search"] { + -webkit-appearance: none; +}*/ +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"].form-control, + input[type="time"].form-control, + input[type="datetime-local"].form-control, + input[type="month"].form-control { + line-height: 34px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 30px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 46px; + } +} +.form-group { + margin-bottom: 15px; +} +/*.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-top: 4px \9; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + vertical-align: middle; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +}*/ +.form-control-static { + min-height: 34px; + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-right: 0; + padding-left: 0; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.form-group-sm select.form-control { + height: 30px; + line-height: 30px; +} +.form-group-sm textarea.form-control, +.form-group-sm select[multiple].form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 30px; + min-height: 32px; + padding: 6px 10px; + font-size: 12px; + line-height: 1.5; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.form-group-lg select.form-control { + height: 46px; + line-height: 46px; +} +.form-group-lg textarea.form-control, +.form-group-lg select[multiple].form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 46px; + min-height: 38px; + padding: 11px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback, +.input-group-lg + .form-control-feedback, +.form-group-lg .form-control + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.input-sm + .form-control-feedback, +.input-group-sm + .form-control-feedback, +.form-group-sm .form-control + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label ~ .form-control-feedback { + top: 25px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + padding-top: 7px; + margin-bottom: 0; + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 11px; + font-size: 18px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + font-size: 12px; + } +} +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #333; + text-decoration: none; +} +.btn:active, +.btn.active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: .65; +} +a.btn.disabled, +fieldset[disabled] a.btn { + pointer-events: none; +} +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; +} +.btn-default:focus, +.btn-default.focus { + color: #333; + background-color: #e6e6e6; + border-color: #8c8c8c; +} +.btn-default:hover { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active:hover, +.btn-default.active:hover, +.open > .dropdown-toggle.btn-default:hover, +.btn-default:active:focus, +.btn-default.active:focus, +.open > .dropdown-toggle.btn-default:focus, +.btn-default:active.focus, +.btn-default.active.focus, +.open > .dropdown-toggle.btn-default.focus { + color: #333; + background-color: #d4d4d4; + border-color: #8c8c8c; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-primary { + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary:focus, +.btn-primary.focus { + color: #fff; + background-color: #286090; + border-color: #122b40; +} +.btn-primary:hover { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary:active:hover, +.btn-primary.active:hover, +.open > .dropdown-toggle.btn-primary:hover, +.btn-primary:active:focus, +.btn-primary.active:focus, +.open > .dropdown-toggle.btn-primary:focus, +.btn-primary:active.focus, +.btn-primary.active.focus, +.open > .dropdown-toggle.btn-primary.focus { + color: #fff; + background-color: #204d74; + border-color: #122b40; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus { + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary .badge { + color: #337ab7; + background-color: #fff; +} +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:focus, +.btn-success.focus { + color: #fff; + background-color: #449d44; + border-color: #255625; +} +.btn-success:hover { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active:hover, +.btn-success.active:hover, +.open > .dropdown-toggle.btn-success:hover, +.btn-success:active:focus, +.btn-success.active:focus, +.open > .dropdown-toggle.btn-success:focus, +.btn-success:active.focus, +.btn-success.active.focus, +.open > .dropdown-toggle.btn-success.focus { + color: #fff; + background-color: #398439; + border-color: #255625; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:focus, +.btn-info.focus { + color: #fff; + background-color: #31b0d5; + border-color: #1b6d85; +} +.btn-info:hover { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active:hover, +.btn-info.active:hover, +.open > .dropdown-toggle.btn-info:hover, +.btn-info:active:focus, +.btn-info.active:focus, +.open > .dropdown-toggle.btn-info:focus, +.btn-info:active.focus, +.btn-info.active.focus, +.open > .dropdown-toggle.btn-info.focus { + color: #fff; + background-color: #269abc; + border-color: #1b6d85; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:focus, +.btn-warning.focus { + color: #fff; + background-color: #ec971f; + border-color: #985f0d; +} +.btn-warning:hover { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active:hover, +.btn-warning.active:hover, +.open > .dropdown-toggle.btn-warning:hover, +.btn-warning:active:focus, +.btn-warning.active:focus, +.open > .dropdown-toggle.btn-warning:focus, +.btn-warning:active.focus, +.btn-warning.active.focus, +.open > .dropdown-toggle.btn-warning.focus { + color: #fff; + background-color: #d58512; + border-color: #985f0d; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:focus, +.btn-danger.focus { + color: #fff; + background-color: #c9302c; + border-color: #761c19; +} +.btn-danger:hover { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active:hover, +.btn-danger.active:hover, +.open > .dropdown-toggle.btn-danger:hover, +.btn-danger:active:focus, +.btn-danger.active:focus, +.open > .dropdown-toggle.btn-danger:focus, +.btn-danger:active.focus, +.btn-danger.active.focus, +.open > .dropdown-toggle.btn-danger.focus { + color: #fff; + background-color: #ac2925; + border-color: #761c19; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-link { + font-weight: normal; + color: #337ab7; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #23527c; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity .15s linear; + -o-transition: opacity .15s linear; + transition: opacity .15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; + -webkit-transition-duration: .35s; + -o-transition-duration: .35s; + transition-duration: .35s; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-top: 4px solid \9; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + background-color: #337ab7; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #777; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + right: 0; + left: auto; +} +.dropdown-menu-left { + right: auto; + left: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px dashed; + border-bottom: 4px solid \9; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn, +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-right: 0; + padding-left: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group .form-control:focus { + z-index: 3; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eee; +} +.nav > li.disabled > a { + color: #777; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #777; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eee; + border-color: #337ab7; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #fff; + background-color: #337ab7; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-right: 0; + padding-left: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } +} +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777; +} +.navbar-default .navbar-nav > li > a { + color: #777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #ccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #ddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #ddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + color: #555; + background-color: #e7e7e7; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #ccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777; +} +.navbar-default .navbar-link:hover { + color: #333; +} +.navbar-default .btn-link { + color: #777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #333; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #ccc; +} +.navbar-inverse { + background-color: #222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #9d9d9d; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #fff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + color: #fff; + background-color: #080808; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #9d9d9d; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #fff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #fff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #9d9d9d; +} +.navbar-inverse .navbar-link:hover { + color: #fff; +} +.navbar-inverse .btn-link { + color: #9d9d9d; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #fff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; +} +.breadcrumb > .active { + color: #777; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #337ab7; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 2; + color: #23527c; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 3; + color: #fff; + cursor: default; + background-color: #337ab7; + border-color: #337ab7; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777; + cursor: not-allowed; + background-color: #fff; +} +/*.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #777; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #5e5e5e; +} +.label-primary { + background-color: #337ab7; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #286090; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: middle; + background-color: #777; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge, +.btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #337ab7; + background-color: #fff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +}*/ +.jumbotron { + padding-top: 30px; + padding-bottom: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron, +.container-fluid .jumbotron { + padding-right: 15px; + padding-left: 15px; + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-right: 60px; + padding-left: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: border .2s ease-in-out; + -o-transition: border .2s ease-in-out; + transition: border .2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-right: auto; + margin-left: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #337ab7; +} +.thumbnail .caption { + padding: 9px; + color: #333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); +} +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #337ab7; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + -webkit-transition: width .6s ease; + -o-transition: width .6s ease; + transition: width .6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-object.img-thumbnail { + max-width: none; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + padding-left: 0; + margin-bottom: 20px; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; +} +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item, +button.list-group-item { + color: #555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333; +} +a.list-group-item:hover, +button.list-group-item:hover, +a.list-group-item:focus, +button.list-group-item:focus { + color: #555; + text-decoration: none; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + color: #777; + cursor: not-allowed; + background-color: #eee; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success, +button.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +button.list-group-item-success:hover, +a.list-group-item-success:focus, +button.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +button.list-group-item-success.active, +a.list-group-item-success.active:hover, +button.list-group-item-success.active:hover, +a.list-group-item-success.active:focus, +button.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info, +button.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +button.list-group-item-info:hover, +a.list-group-item-info:focus, +button.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +button.list-group-item-info.active, +a.list-group-item-info.active:hover, +button.list-group-item-info.active:hover, +a.list-group-item-info.active:focus, +button.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +button.list-group-item-warning:hover, +a.list-group-item-warning:focus, +button.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +button.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus, +button.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +button.list-group-item-danger:hover, +a.list-group-item-danger:focus, +button.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +button.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus, +button.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, .15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: .2; +} +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .5; +} +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; +} +.modal-open { + overflow: hidden; +} +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform .3s ease-out; + -o-transition: -o-transform .3s ease-out; + transition: transform .3s ease-out; + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; +} +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: .5; +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-style: normal; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + white-space: normal; + filter: alpha(opacity=0); + opacity: 0; + + line-break: auto; +} +.tooltip.in { + filter: alpha(opacity=90); + opacity: .9; +} +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + background-color: #000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-left .tooltip-arrow { + right: 5px; + bottom: 0; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + + line-break: auto; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + content: ""; + border-width: 10px; +} +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, .25); + border-bottom-width: 0; +} +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, .25); + border-left-width: 0; +} +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; +} +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, .25); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, .25); +} +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; +} + +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-header:before, +.modal-header:after, +.modal-footer:before, +.modal-footer:after { + display: table; + content: " "; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-header:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-right: auto; + margin-left: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table !important; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table !important; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table !important; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table !important; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table !important; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +/*# sourceMappingURL=bootstrap.css.map */ \ No newline at end of file diff --git a/src/widget/css/front-widget.css b/src/widget/css/front-widget.css new file mode 100644 index 00000000..4154c1e7 --- /dev/null +++ b/src/widget/css/front-widget.css @@ -0,0 +1,31 @@ +.mailjet_widget_front_container { + /*background-color: #5F862F;*/ +} + +.widget-text{ + +} + +.wp_widget_plugin_box{ + +} + +.mj_form_property{ + +} + +#mailjet_widget_title_wrap{ + +} + +#mailjet_widget_title h2 { + font-size: 12px; +} + +#mjForm{ + +} + +#mailjet_widget_email{ + +} \ No newline at end of file diff --git a/src/widget/css/widget.css b/src/widget/css/widget.css new file mode 100644 index 00000000..0e2b722a --- /dev/null +++ b/src/widget/css/widget.css @@ -0,0 +1,406 @@ +.form-group{ + margin-bottom: 10px!important; +} + +.form-control{ + border-radius: 0px!important; + background-color: #FFF !important; + border: 1px solid #888 !important; + +} + +.selectProperty{ + height: 32px!important; +} +.propertyDataType{ + height: 32px!important; +} + +.language_checkbox{ + height: 17px; + width: 17px; + border: 1px solid #979797; + background-color: #FFFFFF; + margin-top: 1px!important; +} + +.propertiesInfo{ + font-size: 14px; +} + +.mailjet_widget_admin_container { + margin-top: 10px; + margin-bottom: 10px; + /*background-color: #00a0d2;*/ +} +.mailjet_widget_front_container { + /*background-color: #5F862F;*/ +} + +#chooseLangLabelWrap { + margin: 20px 0 20px 0; +} + +#chooseLangLabel { + font-weight: bold; + font-size: small; +} + +.hidden_default { + display: none; +} + +.some-space{ + margin: 20px 0 20px 0; +} + +.language-label{ + font-weight: bold; + text-decoration: appworkspace; + margin: 10px; + margin-bottom: 0px; + font-size: 12px; +} + +.language-title-label{ + font-weight: 600; +} + +.dropdown-list{ + height: 40px!important; + margin: 8px 0; +} + +.title-input{ + width: 100%; + padding: 12px; + margin: 8px 0; + box-sizing: border-box; +} + +.language-wrap{ + padding: 10px; + border-bottom: 1px solid #898899; + border-bottom-width: thin; + border-right: 1px solid #898899; + border-right-width: thin; + border-left: 1px solid #898899; + border-left-width: thin; +} + +.language-wrap:first-child{ + border-top: 1px solid #898899; + border-top-width: thin; +} + +.language-wrap hr{ + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} + +#advanced-form-link{ + text-decoration: underline; + cursor: pointer; + height: 14px; + width: 158px; + color: #018EC2; + font-family: Helvetica; + font-size: 12px!important; + line-height: 14px; + +} + +#advanced-form-link:hover{ + color: #00a0d2; +} + +#advanced-form-link-info{ + font-weight: bold; + cursor: pointer; +} + +#properties-info{ + font-weight: bold; + margin: 30px 0 5px 23px; +} + +.property{ + clear: left; + padding: 1%; + /*margin-left: 30px*/ + margin-left: 44px; + margin-top: 39px; +} + +.newPropertyFields{ + display: none; +} + +.properties-label-header{ + margin-bottom: 10px; + +} +.floatLeft{ + float: left; + /*margin-left: 1%;*/ + margin-left: 12px; +} + +.propertyLabel{ + margin: 9px 0; + +} + +.propertySelect select{ + max-width: 140px; +} + +.typeSelect select{ + width: 94px; + /*margin-left: 10px;*/ +} + +.languageInput{ + min-width: 8%; +} + +.languageInput input{ + width: 100%; + height: 32px; + background-color: #FFF !important; + border: 1px solid #888 !important; +} + +.deleteProperty{ + width: 15px; + margin: 8px; + /*display: none;*/ +} + +.hiddenProperties{ + /*display: none;*/ +} + +.hiddenSelectProperties{ + /*display: none;*/ +} + +.createNewProperties{ + display: none; +} + +.newPropertyName{ + width: 30%; +} + +.newPropertyName input{ + width: 100%; + height: 32px; +} + +.newPropertyType select{ + width: 100%; + height: 32px; + /*margin-left: 10px;*/ +} + +.saveNewPropertyButton{ + /*margin-left: -25px!important;*/ + font-size: 12px!important; +/* height: 20px!important; + width: 70px!important;*/ + border: 1px solid #B8B8B8 !important; + border-radius: 3px !important; + background-color: #FFFFFF !important; +} + +.cancelNewPropertyButton{ + font-size: 12px!important; + margin-left: -2px!important; + height: 14px!important; + width: 40px!important; + color: #9B9B9B !important; + font-family: Helvetica; + font-size: 12px!important; + font-weight: bold!important; + line-height: 14px!important; +} + +.cancelNewPropertyButton { + color: silver; +} + + +@media (min-width: 992px) { + .modal-mailjet-lg { + width: 1200px!important; + height: 900px; /* control height here */ + /*margin: 40px 0 0 145px!important;*/ + } +} + +.customize-mandatory-email{ + font-weight: bold; + /* font-size: 14px;*/ + margin: 70px 0 10px 23px; + clear: left; +} + +.customize-mandatory-button{ + font-weight: bold; + /*font-size: 14px;*/ + margin: 70px 0 10px 13px; + clear: left; +} + +#mandatory-wrap{ + clear: left; + padding: 1%; +} + +.mandatoryEmailLabel{ + width: 250px; + margin-top: 27px; + margin-right: 60px; + /*margin-left: 30px;*/ + margin-left: 44px; +} + +.mandatoryEmailLanguageInput input { + width: 100%!important; + height: 32px; + /*width: 136px;*/ +} + +.mandatoryButtonLanguage{ + width: 250px; +} + +.mandatoryButtonLanguage input{ + height: 32px; +} + +.validation_message_row{ + clear: left; +} + +.confirmation_email_row{ + clear: left; +} + +.validation_messages_labels{ + height: auto!important; + width: 240px!important; + border: 0px solid transparent!important; + margin-left: -12px; +} + +#mailjet_widget_title h2 { + font-size: 12px; +} + +.input-required{ + color: red; +} + +.tab-info{ + margin: 25px 10px 30px; +} + +.advanced-form-validation-messages select{ + height: 110px!important; +} + +.modal-title{ + font-weight: bold; +} + +.modal-header{ + border-bottom: none!important; +} + +.redInput{ + border: 1px solid red!important; +} + +.advanced-form-fields{ + overflow-y: scroll; + height: 502px; +} + +/* width */ +.tab-pane::-webkit-scrollbar { + width: 11px; +} + +/* Track */ +::-webkit-scrollbar-track { + background-color: transparent; + -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0.1); +} + +/* Handle */ +.tab-pane::-webkit-scrollbar-thumb { + background: #D8D8D8; + border-radius: 7.5px; +} + +/* Handle on hover */ +.tab-pane::-webkit-scrollbar-thumb:hover { + background: #D3D3D3; +} + +/* SCROLL BAR TEXTAREAS */ + +/* width */ +.tab-pane textarea::-webkit-scrollbar { + width: 6px; +} + +/* Track */ +.tab-pan textarea::-webkit-scrollbar-track { + background: #F6F6F6; +} + +/* Handle */ +.tab-pane textarea::-webkit-scrollbar-thumb { + background: #D9D9D9; +} + +/* Handle on hover */ +.tab-pane textarea::-webkit-scrollbar-thumb:hover { + background: #D3D3D3; +} + +/*.advanced-form-validation-messages textarea{ + width: 140px!important; +}*/ + +#advanced-form-navs a{ + text-decoration: none!important; +} + +#exampleModalLabel{ + margin: 0; + line-height: 1.42857143; + font-weight: bold; + font-size: 18px; +} + +.modal-content label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: 700; +} + +.mailjet_widget_admin_container span { + font-size: 14px; +} + +.modal-content{ + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 14px; +} diff --git a/src/widget/fonts/glyphicons-halflings-regular.eot b/src/widget/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 00000000..b93a4953 Binary files /dev/null and b/src/widget/fonts/glyphicons-halflings-regular.eot differ diff --git a/src/widget/fonts/glyphicons-halflings-regular.svg b/src/widget/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 00000000..94fb5490 --- /dev/null +++ b/src/widget/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/widget/fonts/glyphicons-halflings-regular.woff2 b/src/widget/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 00000000..64539b54 Binary files /dev/null and b/src/widget/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/src/widget/js/widget.js b/src/widget/js/widget.js new file mode 100644 index 00000000..247a7db1 --- /dev/null +++ b/src/widget/js/widget.js @@ -0,0 +1,296 @@ +(function ($) { + "use strict"; + $(function () { + + $(document).on('widget-updated', function (event, widget) { + var widget_id = $(widget).attr('id'); +// alert('On widget-updated: ' + widget_id); + + showCheckedLanguages(); + // any code that needs to be run when a widget gets updated goes here + // widget_id holds the ID of the actual widget that got updated + // be sure to only run the code if one of your widgets got updated + // otherwise the code will be run when any widget is updated + }); + + $(document).on('widget-added', function (event, widget) { + var widget_id = $(widget).attr('id'); +// alert('On widget-added: ' + widget_id); + // any code that needs to be run when a new widget gets added goes here + // widget_id holds the ID of the actual widget that got added + // be sure to only run the code if one of your widgets got added + // otherwise the code will be run when any widget is added + }); + + // Toggle(show/hide) hidden language elements(title, contactList) + $(document).on('change', '.language_checkbox', function () { + + // Show/Colapse + var languageHiddenElementClass = getLanguageHiddenElements(this); + $('#' + languageHiddenElementClass).toggle("slow"); + + // Uncheck the language checkbox + var removeLanguage = !$(this).prop('checked'); + if (removeLanguage) { + // Reset Title and List ? +// $(this).parent().find('.title-input').val(''); +// $(this).parent().find('.language-select-list').val(0); + } else { + // Add specific language + var languageListId = $(this).parent().find('.language-select-list').val(); + if (languageListId === "0") { + $(this).parent().find('.language-select-list').css({'border': '1px solid red'}); + } + } + + + // Hide advanced form, changes must be saved +// $("div#advanced-form-link-wrap").hide(); + }); + + $(document).on('change', '.language-select-list', function (event) { + var languageListId = event.target.value; + if (languageListId === "0") { + // No contact list is selected + $(this).parent().find('.language-select-list').css({'border': '1px solid red'}); + } else { + // A contact list is selected + $(this).parent().find('.language-select-list').css({'border': '1px solid green'}); + } + }); + + $(document).on('click', '.saveNewPropertyButton', function () { + + var element = $(this); + + // Get new property name value + var newPropertyName = element.parent().parent().find('.newPropertyName input').val(); + // Get new property type + var newPropertyType = element.parent().parent().find('.newPropertyType select').val(); + + var selectProperty = element.parent().parent().find('.selectProperty'); + + // ajax request to create the new property + jQuery.ajax({ + type: "post", + dataType: "json", + url: myAjax.ajaxurl, + data: {action: "mailjet_add_contact_property", propertyName: newPropertyName, propertyType: newPropertyType}, + success: function (response) { + if (response !== null && response[0] !== undefined && response[0].ID !== undefined) { + + // Reset elements + resetHiddenPropertiesInputs(element); + resetAddingNewPropertyInputs(element, 'Text'); + + // Hide new property inputs + element.parent().parent().find('.createNewProperties').hide(); + + // Show datatype and languages inputs/values and delete + element.parent().parent().find('.hiddenProperties').show(); + + // Show next default property select + element.parent().parent().next('.property').show(); + + // Remove the delete icon for the previous row + element.parent().parent().prev().find('.deleteProperty').hide(); + + // Remove class as the input value is ok + element.parent().parent().find('.newPropertyName input').removeClass('redInput'); + + // Add the new property and select it + selectProperty.append(''); + } else { + element.parent().parent().find('.newPropertyName input').addClass('redInput'); + element.parent().parent().find('.newPropertyName input').val(''); + } + } + }); + + }); + + // Select a contact property + $(document).on('change', '.selectProperty', function (event) { + var optionValue = event.target.value; + + // Create new property + if (optionValue === 'newProperty') { + // Hide select property inputs + $(this).parent().parent().find('.hiddenProperties').hide(); + + // Show new property inputs + $(this).parent().parent().find('.createNewProperties').show(); + + // Do not delete + // Hide all rows that are not setup +// $('.selectProperty').each(function (env) { +// if ($(this).val() === null) { +// $(this).parent().parent().hide(); +// } +// }); + + // Show next default property select +// $(this).parent().parent().next('.property').hide(); + } else { + // Show datatype and languages inputs/values and delete + $(this).parent().parent().find('.hiddenProperties').show(); + + // Hide inputs of adding new property + $(this).parent().parent().find('.createNewProperties').hide(); + + // Reset inputs for adding new property + resetAddingNewPropertyInputs($(this)); + + // Show next default property select + $(this).parent().parent().next('.property').show(); + + // Remove the delete icon for the previous row + $(this).parent().parent().prev().find('.deleteProperty').hide(); + } + }); + + // Delete a property + $(document).on('click', '.deleteProperty', function (event) { + + // Hide row properties and only property select left + $(this).parent().parent().find('.hiddenProperties').hide(); + + // Hide next row as the deleted stays the current + $(this).parent().parent().next('.property').hide(); + + // Show delete icon for the last row + $(this).parent().parent().prev().find('.deleteProperty').show(); + + resetHiddenPropertiesInputs($(this)); + }); + + function resetHiddenPropertiesInputs(element) { + // Reset selects + element.parent().parent().find('.selectProperty').val(0); + element.parent().parent().find('.propertyDataType').val(0); + + // Reset language inputs + element.parent().parent().find('.languageInput input').val(''); + + // Remove class as the input value is ok + element.parent().parent().find('.newPropertyName input').removeClass('redInput'); + } + + function resetAddingNewPropertyInputs(element, resetElementValue = 0) { + // Reset new property name input + element.parent().parent().find('.newPropertyName input').val(''); + + // Reset new property datatype select + element.parent().parent().find('.newPropertyType input').val(resetElementValue); + } + + $(document).on('click', '#saveAdvancedForm', function () { + $("input[name='savewidget']").click(); + $(this).text("Saving...").prop('disabled', true); + }); + + // Show/hide advnaced form link depends on Save button + $(document).on('change', $("input[name='savewidget']"), function () { + var isSaveButtonDisabled = $(this).is(":disabled"); + if (isSaveButtonDisabled) { + $("div.advanced-form-link-wrap").show(); + } else { + $("div.advanced-form-link-wrap").hide(); + } +// $("div#advanced-form-link-wrap").hide(); +// $("span#advanced-form-link").hide(); + }); + + // Fires when property value is changed + $(document).on('change', '.propertyDataType', function () { + var optionValue = event.target.value; + var defaultPlaceholder = 'Field label in'; + var hiddenPlaceholder = 'Value for'; + if (optionValue === '2') { + // When 'hidden' option is selected + replaceLanguagePlaceholder($(this), defaultPlaceholder, hiddenPlaceholder); + } else { + replaceLanguagePlaceholder($(this), hiddenPlaceholder, defaultPlaceholder); + } + }); + + $(document).on('click', '.cancelNewPropertyButton', function () { + // Hide new property inputs + $(this).parent().parent().find('.createNewProperties').hide(); + + // Reset inputs + resetHiddenPropertiesInputs($(this)); + + // Show select property inputs +// $(this).parent().parent().find('.hiddenProperties').show(); + + // Show next default property select +// $(this).parent().parent().next('.property').show(); + + }); + + function replaceLanguagePlaceholder(element, searchStr, replaceStr) { + element.parent().parent().parent().find('.languageInput input').each(function (env) { + if (!$(this).val()) { + var str = $(this).attr("placeholder"); + var res = str.replace(searchStr, replaceStr); + $(this).attr("placeholder", res); + } + }); + } + + init(); + + /** + * Show checked languages + * Activate tooltips + * Activate tabs + * @returns {undefined} + */ + function init() { + showCheckedLanguages(); + $('[data-toggle="tooltip"]').tooltip(); +// showPropertySelect(1); + } + +// function showPropertySelect(n) { +// var selectProperties = $('.selectProperty'); +// var opened = 0; +// selectProperties.each(function (index, value) { +// if (opened >= n) { +// return false; +// } +// $(this).parent().parent().find('.hiddenSelectProperties').show(); +// $(this).parent().parent().parent().find('.hiddenSelectProperties').show(); +// $(this).parent().find('.hiddenSelectProperties').show(); +// $(this).parent().parent().find('.hiddenSelectProperties').css({'display':'block'}); +// opened = opened + 1; +// }); +// } + + /** + * Show the hidden elements of the checked languages + * @returns {undefined} + */ + function showCheckedLanguages() { + $('.language_checkbox').each(function (index, value) { + if (value.checked === true) { + var languageHiddenElementClass = getLanguageHiddenElements(value); + $('#' + languageHiddenElementClass).show(); + } + }); + } + + /** + * Get the id of the hidden elements of a specific language checkbox + * @param {type} element + * @returns {String} + */ + function getLanguageHiddenElements(element) { + var language = (element); + var languageId = language.getAttribute('id'); + return 'hidden_' + languageId; + } + + }); +}(jQuery)); \ No newline at end of file diff --git a/src/widget/templates/thankyou.php b/src/widget/templates/thankyou.php new file mode 100644 index 00000000..020e766e --- /dev/null +++ b/src/widget/templates/thankyou.php @@ -0,0 +1,51 @@ + + + + Subscription + + + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    confirm subscription
    +
    +
    +
    + +
    +
    +
    +
    +

    + + + + \ No newline at end of file diff --git a/src/widget/views/admin.php b/src/widget/views/admin.php new file mode 100644 index 00000000..879d9384 --- /dev/null +++ b/src/widget/views/admin.php @@ -0,0 +1,503 @@ + $locale) { + if (isset($instance[$locale]) && isset($instance[$locale]['language_checkbox']) && $instance[$locale]['language_checkbox']) { + $activeLanguages[$language] = $locale; + } +} + +$numberActiveLanguages = count($activeLanguages); +//$pxPerLang = 136; +//$totalWidth = $numberActiveLanguages * $pxPerLang; +//$percent = $totalWidth/$numberActiveLanguages.'px'; +$maxWidth = 60; +if($numberActiveLanguages == 1) { + $percent = 30; +} else { + $percent = $numberActiveLanguages > 0 ? $maxWidth / $numberActiveLanguages : $maxWidth; +} +?> + +
    +
    + '', + 'title' => '', + 'list' => '', + ); + + $this->registerCustomLanguageTranslations(); + foreach ($languages as $language => $locale) { + $pass_args_data = isset($instance[$locale]) ? $instance[$locale]: array(); + extract(wp_parse_args($pass_args_data, $defaults)); + ?> +
    + /> + + +
    +
    +

    + + +

    +

    + + +

    +
    +
    + + + + +
    diff --git a/src/widget/views/designforfailure.php b/src/widget/views/designforfailure.php new file mode 100644 index 00000000..3eaf07fe --- /dev/null +++ b/src/widget/views/designforfailure.php @@ -0,0 +1,9 @@ +

    + https://app.mailjet.com/account/api_keys', 'wp-mailjet'); + } else { + _e('Could not connect to mailjet api, please try again later!', 'wp-mailjet'); + } + ?> +

    \ No newline at end of file diff --git a/src/widget/views/widget.php b/src/widget/views/widget.php new file mode 100644 index 00000000..e317dbae --- /dev/null +++ b/src/widget/views/widget.php @@ -0,0 +1,135 @@ + + + +
    + +
    + + +
    + + + +
    + + + +
    + + +
    + + +
    + propertyData[$contactPropertyId])) { + continue; + } + + // Mailjet property type + $propertyDataType = $this->propertyData[$contactPropertyId]['Datatype']; + + // Map mailjet property type to valid input type + $inputType = $this->getInputType($propertyDataType); + + + // The value of the label + $placeholder = $instance[$locale][$language . 'Label' . $i]; + + // '0' - optional + // '1' - mandatory + // '2' - hidden + $propertyType = (int) $instance[$locale]['propertyDataType' . $i]; + + // Display block by default + $display = 'block'; + + // Not required by default + $required = ''; + + // Used on hidden properties + $value = ''; + + $requiredStar = ''; + + // Set required, display and value depends on the current property type + switch ($propertyType) { + // Optional input + case 0: + // Display: block + // No value, only placeholder + // Not Required + break; + // Mandatory input + case 1: + // Display: block + // No value, only placeholder + + // Required + $required = 'required'; + + // Add * to placeholder to indicate that the input is required + $requiredStar = '* '; + break; + // Hidden input + case 2: + // Display: none + $display = 'none'; + + // Value is given from admin advanced settings + $value = 'value="'.$placeholder.'"'; + break; + } + $class = ''; + if ($inputType == 'date') { + $class = 'mjDate'; + } + ?> +
    + type="text" class="mj_form_property " name="properties[]" placeholder="" style="display: "> +
    + + +
    + +
    +
    \ No newline at end of file diff --git a/uninstall.php b/uninstall.php index d7c823ea..15522bc0 100644 --- a/uninstall.php +++ b/uninstall.php @@ -1,29 +1,73 @@ - +Click here to lend your support to: Analog and make a donation at www.pledgie.com ! + +A PHP logging package based on the idea of using closures +for configurability and extensibility. It functions as a static class, but you can +completely control the writing of log messages through a closure function +(aka [anonymous functions](http://ca3.php.net/manual/en/functions.anonymous.php)), +or use the `Analog\Logger` wrapper that implements the +[PSR-3 specification](https://www.php-fig.org/psr/psr-3/). + +## Installation + +Install the latest version with: + +```bash +$ composer require jbroadway/analog +``` + +## Usage + +### Basic Usage + +```php +handler (Variable::init ($log)); + +$logger->alert ('Things are really happening right now!'); + +var_dump ($log); +``` + +### Usage with a custom handler + +```php +mydb->log->insert ($info); +}); + +// Log an alert +Analog::log ('The sky is falling!', Analog::ALERT); + +// Log some debug info +Analog::log ('Debugging info', Analog::DEBUG); +``` + +For more examples, see the [examples](https://github.com/jbroadway/analog/tree/master/examples) folder. + +## Logging Options + +By default, this class will write to a file named `sys_get_temp_dir() . '/analog.txt'` +using the format `"machine - date - level - message\n"`, making it usable with no +customization necessary. + +Analog also comes with over a dozen pre-written handlers in the Analog/Handlers folder, +with examples for each in the examples folder. These include: + +* Amon - Send logs to the [Amon](http://amon.cx/) server monitoring tool +* Buffer - Buffer messages to send all at once (works with File, Mail, Stderr, and Variable handlers) +* ChromeLogger - Sends messages to [Chrome Logger](http://craig.is/writing/chrome-logger) browser plugin +* File - Append messages to a file +* FirePHP - Send messages to [FirePHP](http://www.firephp.org/) browser plugin +* GELF - Send message to the [Graylog2](http://www.graylog2.org/) log management server +* Ignore - Do nothing +* LevelBuffer - Buffer messages and send only if sufficient error level reached +* LevelName - Convert log level numbers to names in log output +* Mail - Send email notices +* Mongo - Save to MongoDB collection +* Multi - Send different log levels to different handlers +* Post - Send messages over HTTP POST to another machine +* Slackbot - Post messages to Slack via Slackbot +* Stderr - Send messages to STDERR +* Syslog - Send messages to syslog +* Threshold - Only writes log messages above a certain threshold +* Variable - Buffer messages to a variable reference. + +So while it's a micro class, it's highly extensible and very capable out of the box too. + +## Rationale + +I wrote this because I wanted something very small and simple like +[KLogger](https://github.com/katzgrau/KLogger), and preferably not torn out +of a wider framework if possible. After searching, I wasn't happy with the +single-purpose libraries I found. With KLogger for example, I didn't want an +object instance but rather a static class, and I wanted more flexibility in +the back-end. + +I also found some that had the flexibility also had more complexity, for example +[Monolog](https://github.com/Seldaek/monolog) is dozens of source files (not incl. tests). +With closures, this seemed to be a good balance of small without sacrificing +flexibility. + +> What about Analog, the logfile analyzer? Well, since it hasn't been updated +> since 2004, I think it's safe to call a single-file PHP logging class the +> same thing without it being considered stepping on toes :) diff --git a/vendor/analog/analog/composer.json b/vendor/analog/analog/composer.json new file mode 100644 index 00000000..2acbbd9d --- /dev/null +++ b/vendor/analog/analog/composer.json @@ -0,0 +1,27 @@ +{ + "name": "analog/analog", + "type": "library", + "description": "PHP logging class that can be extended via closures. Includes several pre-built handlers including file, mail, syslog, HTTP post, and MongoDB.", + "keywords": ["log", "logging", "logger", "syslog", "error", "debug", "debugging", "alerts"], + "homepage": "https://github.com/jbroadway/analog", + "license": "MIT", + "authors": [ + { + "name": "Johnny Broadway", + "email": "johnny@johnnybroadway.com", + "homepage": "http://www.johnnybroadway.com/" + } + ], + "require": { + "psr/log": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" + }, + "autoload": { + "psr-0": { + "Analog": "lib/" + } + } +} diff --git a/vendor/analog/analog/examples/SplClassLoader.php b/vendor/analog/analog/examples/SplClassLoader.php new file mode 100644 index 00000000..656a0120 --- /dev/null +++ b/vendor/analog/analog/examples/SplClassLoader.php @@ -0,0 +1,155 @@ +. + */ + +/** + * SplClassLoader implementation that implements the technical interoperability + * standards for PHP 5.3 namespaces and class names. + * + * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 + * + * // Example which loads classes for the Doctrine Common package in the + * // Doctrine\Common namespace. + * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); + * $classLoader->register(); + * + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @author Jonathan H. Wage + * @author Roman S. Borschel + * @author Matthew Weier O'Phinney + * @author Kris Wallsmith + * @author Fabien Potencier + */ +class SplClassLoader +{ + private $_fileExtension = '.php'; + private $_namespace; + private $_includePath; + private $_namespaceSeparator = '\\'; + + /** + * Creates a new SplClassLoader that loads classes of the + * specified namespace. + * + * @param string $ns The namespace to use. + */ + public function __construct($ns = null, $includePath = null) + { + $this->_namespace = $ns; + $this->_includePath = $includePath; + } + + /** + * Sets the namespace separator used by classes in the namespace of this class loader. + * + * @param string $sep The separator to use. + */ + public function setNamespaceSeparator($sep) + { + $this->_namespaceSeparator = $sep; + } + + /** + * Gets the namespace seperator used by classes in the namespace of this class loader. + * + * @return void + */ + public function getNamespaceSeparator() + { + return $this->_namespaceSeparator; + } + + /** + * Sets the base include path for all class files in the namespace of this class loader. + * + * @param string $includePath + */ + public function setIncludePath($includePath) + { + $this->_includePath = $includePath; + } + + /** + * Gets the base include path for all class files in the namespace of this class loader. + * + * @return string $includePath + */ + public function getIncludePath() + { + return $this->_includePath; + } + + /** + * Sets the file extension of class files in the namespace of this class loader. + * + * @param string $fileExtension + */ + public function setFileExtension($fileExtension) + { + $this->_fileExtension = $fileExtension; + } + + /** + * Gets the file extension of class files in the namespace of this class loader. + * + * @return string $fileExtension + */ + public function getFileExtension() + { + return $this->_fileExtension; + } + + /** + * Installs this class loader on the SPL autoload stack. + */ + public function register() + { + spl_autoload_register(array($this, 'loadClass')); + } + + /** + * Uninstalls this class loader from the SPL autoloader stack. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $className The name of the class to load. + * @return void + */ + public function loadClass($className) + { + if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) { + $fileName = ''; + $namespace = ''; + if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { + $namespace = substr($className, 0, $lastNsPos); + $className = substr($className, $lastNsPos + 1); + $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; + + require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; + } + } +} diff --git a/vendor/analog/analog/examples/amon.php b/vendor/analog/analog/examples/amon.php new file mode 100644 index 00000000..0f4f1f1b --- /dev/null +++ b/vendor/analog/analog/examples/amon.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/buffer.php b/vendor/analog/analog/examples/buffer.php new file mode 100644 index 00000000..d6518fee --- /dev/null +++ b/vendor/analog/analog/examples/buffer.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/chromelogger.php b/vendor/analog/analog/examples/chromelogger.php new file mode 100644 index 00000000..e3c58243 --- /dev/null +++ b/vendor/analog/analog/examples/chromelogger.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/default.php b/vendor/analog/analog/examples/default.php new file mode 100644 index 00000000..86517daf --- /dev/null +++ b/vendor/analog/analog/examples/default.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/file.php b/vendor/analog/analog/examples/file.php new file mode 100644 index 00000000..82475256 --- /dev/null +++ b/vendor/analog/analog/examples/file.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/firephp.php b/vendor/analog/analog/examples/firephp.php new file mode 100644 index 00000000..48f7744c --- /dev/null +++ b/vendor/analog/analog/examples/firephp.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/gelf.php b/vendor/analog/analog/examples/gelf.php new file mode 100644 index 00000000..5413955d --- /dev/null +++ b/vendor/analog/analog/examples/gelf.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/ignore.php b/vendor/analog/analog/examples/ignore.php new file mode 100644 index 00000000..f5f766ec --- /dev/null +++ b/vendor/analog/analog/examples/ignore.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/levelbuffer.php b/vendor/analog/analog/examples/levelbuffer.php new file mode 100644 index 00000000..a70e1372 --- /dev/null +++ b/vendor/analog/analog/examples/levelbuffer.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/mail.php b/vendor/analog/analog/examples/mail.php new file mode 100644 index 00000000..176976d8 --- /dev/null +++ b/vendor/analog/analog/examples/mail.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/mongo.php b/vendor/analog/analog/examples/mongo.php new file mode 100644 index 00000000..9a1f290a --- /dev/null +++ b/vendor/analog/analog/examples/mongo.php @@ -0,0 +1,21 @@ +testing->log->find (); +foreach ($cur as $doc) { + print_r ($doc); +} +$m->testing->log->remove (); + +?> diff --git a/vendor/analog/analog/examples/multi.php b/vendor/analog/analog/examples/multi.php new file mode 100644 index 00000000..932459d5 --- /dev/null +++ b/vendor/analog/analog/examples/multi.php @@ -0,0 +1,27 @@ + Analog\Handler\Variable::init ($errors), + Analog::WARNING => Analog\Handler\Variable::init ($warnings), + Analog::DEBUG => Analog\Handler\Variable::init ($debug) +))); + +Analog::log ('First error'); +Analog::log ('Emergency!', Analog::URGENT); +Analog::log ('A warning...', Analog::WARNING); +Analog::log ('Some info', Analog::INFO); +Analog::log ('Debugging output', Analog::DEBUG); + +echo $errors; +echo "-----\n"; +echo $warnings; +echo "-----\n"; +echo $debug; + +?> \ No newline at end of file diff --git a/vendor/analog/analog/examples/post.php b/vendor/analog/analog/examples/post.php new file mode 100644 index 00000000..520f6274 --- /dev/null +++ b/vendor/analog/analog/examples/post.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/psr-0.php b/vendor/analog/analog/examples/psr-0.php new file mode 100644 index 00000000..7b23c3b0 --- /dev/null +++ b/vendor/analog/analog/examples/psr-0.php @@ -0,0 +1,19 @@ +register (); + +use \Analog\Analog; + +$log = ''; + +Analog::handler (\Analog\Handler\Variable::init ($log)); + +Analog::log ('Test one'); +Analog::log ('Test two'); + +echo $log; + +?> \ No newline at end of file diff --git a/vendor/analog/analog/examples/server.php b/vendor/analog/analog/examples/server.php new file mode 100644 index 00000000..35b5dbaf --- /dev/null +++ b/vendor/analog/analog/examples/server.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/slackbot.php b/vendor/analog/analog/examples/slackbot.php new file mode 100644 index 00000000..b153e3a0 --- /dev/null +++ b/vendor/analog/analog/examples/slackbot.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/stderr.php b/vendor/analog/analog/examples/stderr.php new file mode 100644 index 00000000..b3a0d702 --- /dev/null +++ b/vendor/analog/analog/examples/stderr.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/syslog.php b/vendor/analog/analog/examples/syslog.php new file mode 100644 index 00000000..cc992473 --- /dev/null +++ b/vendor/analog/analog/examples/syslog.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/threshold.php b/vendor/analog/analog/examples/threshold.php new file mode 100644 index 00000000..2c9b9efd --- /dev/null +++ b/vendor/analog/analog/examples/threshold.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/examples/variable.php b/vendor/analog/analog/examples/variable.php new file mode 100644 index 00000000..5b2e7d1f --- /dev/null +++ b/vendor/analog/analog/examples/variable.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog.php b/vendor/analog/analog/lib/Analog.php new file mode 100644 index 00000000..7f083f82 --- /dev/null +++ b/vendor/analog/analog/lib/Analog.php @@ -0,0 +1,22 @@ +mydb->log->insert ($info); + * }); + * + * // Log an alert + * Analog::log ('The sky is falling!', Analog::ALERT); + * + * // Log some debug info + * Analog::log ('Debugging info', Analog::DEBUG); + * + * ?> + * + * @package Analog + * @author Johnny Broadway + */ +class Analog { + /** + * List of severity levels. + */ + const URGENT = 0; // It's an emergency + const ALERT = 1; // Immediate action required + const CRITICAL = 2; // Critical conditions + const ERROR = 3; // An error occurred + const WARNING = 4; // Something unexpected happening + const NOTICE = 5; // Something worth noting + const INFO = 6; // Information, not an error + const DEBUG = 7; // Debugging messages + + /** + * The default format for log messages (machine, date, level, message) + * written to a file. To change the order of items in the string, + * use `%1$s` references. + */ + public static $format = "%s - %s - %d - %s\n"; + + /** + * The default date/time format for log messages written to a file. + * Feeds into the `$format` property. + */ + public static $date_format = 'Y-m-d H:i:s'; + + /** + * Timezone for date/time values. + */ + public static $timezone = 'GMT'; + + /** + * Default log level. + */ + public static $default_level = 3; + + /** + * The method of saving the log output. See Analog::handler() + * for details on setting this. + */ + private static $handler = null; + + /** + * The name of the current machine, defaults to $_SERVER['SERVER_ADDR'] + * on first call to format_message(), or 'localhost' if $_SERVER['SERVER_ADDR'] + * is not set (e.g., during CLI use). + */ + public static $machine = null; + + /** + * Handler getter/setter. If no handler is provided, it will set it to + * sys_get_temp_dir() . '/analog.txt' as a default. Usage: + * + * Analog::handler ('my_log.txt'); + * + * Using a closure: + * + * Analog::handler (function ($msg) { + * return error_log ($msg); + * }); + */ + public static function handler ($handler = false) { + if ($handler) { + self::$handler = $handler; + } elseif (! self::$handler) { + self::$handler = realpath (sys_get_temp_dir ()) . DIRECTORY_SEPARATOR . 'analog.txt'; + } + return self::$handler; + } + + /** + * Get the log info as an associative array. + */ + private static function get_struct ($message, $level) { + if (self::$machine === null) { + self::$machine = (isset ($_SERVER['SERVER_ADDR'])) ? $_SERVER['SERVER_ADDR'] : 'localhost'; + } + + $dt = new \DateTime ('now', new \DateTimeZone (self::$timezone)); + + return array ( + 'machine' => self::$machine, + 'date' => $dt->format (self::$date_format), + 'level' => $level, + 'message' => $message + ); + } + + /** + * Write a raw message to the log using a function or the default + * file logging. + */ + private static function write ($struct) { + $handler = self::handler (); + + if (! $handler instanceof \Closure) { + $handler = \Analog\Handler\File::init ($handler); + } + return $handler ($struct); + } + + /** + * This is the main function you will call to log messages. + * Defaults to severity level Analog::ERROR, which can be + * changed via the `$default_level` property. + * Usage: + * + * Analog::log ('Debug info', Analog::DEBUG); + */ + public static function log ($message, $level = null) { + $level = ($level !== null) ? $level : self::$default_level; + return self::write (self::get_struct ($message, $level)); + } + + /** + * Shortcut method for Analog::log($info, Analog::URGENT) + * Usage: + * + * Analog::urgent ('Debug info'); + */ + public static function urgent ($message) { + return self::write (self::get_struct ($message, self::URGENT)); + } + + /** + * Shortcut method for Analog::log($info, Analog::ALERT) + * Usage: + * + * Analog::alert ('Debug info'); + */ + public static function alert ($message) { + return self::write (self::get_struct ($message, self::ALERT)); + } + + /** + * Shortcut method for Analog::log($info, Analog::ERROR) + * Usage: + * + * Analog::error ('Debug info'); + */ + public static function error ($message) { + return self::write (self::get_struct ($message, self::ERROR)); + } + + /** + * Shortcut method for Analog::log($info, Analog::WARNING) + * Usage: + * + * Analog::warning ('Debug info'); + */ + public static function warning ($message) { + return self::write (self::get_struct ($message, self::WARNING)); + } + + /** + * Shortcut method for Analog::log($info, Analog::NOTICE) + * Usage: + * + * Analog::notice ('Debug info'); + */ + public static function notice ($message) { + return self::write (self::get_struct ($message, self::NOTICE)); + } + + /** + * Shortcut method for Analog::log($info, Analog::INFO) + * Usage: + * + * Analog::info ('Debug info'); + */ + public static function info ($message) { + return self::write (self::get_struct ($message, self::INFO)); + } + + /** + * Shortcut method for Analog::log($info, Analog::DEBUG) + * Usage: + * + * Analog::debug ('Debug info'); + */ + public static function debug ($message) { + return self::write (self::get_struct ($message, self::DEBUG)); + } + +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog/Handler/Amon.php b/vendor/analog/analog/lib/Analog/Handler/Amon.php new file mode 100644 index 00000000..3184e6bf --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Amon.php @@ -0,0 +1,43 @@ + $host, + 'port' => $port, + 'application_key' => $key + )); + + $tags = array ( + 0 => 'urgent', + 1 => 'alert', + 2 => 'critical', + 3 => 'error', + 4 => 'warning', + 5 => 'notice', + 6 => 'info', + 7 => 'debug' + ); + + return function ($info) use ($tags) { + \Amon::log ($info, array ($tags[$info['level']])); + }; + } +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog/Handler/Buffer.php b/vendor/analog/analog/lib/Analog/Handler/Buffer.php new file mode 100644 index 00000000..298ad6e9 --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Buffer.php @@ -0,0 +1,59 @@ + 'LOG', + \Analog\Analog::INFO => 'INFO', + \Analog\Analog::NOTICE => 'INFO', + \Analog\Analog::WARNING => 'WARN', + \Analog\Analog::ERROR => 'ERROR', + \Analog\Analog::CRITICAL => 'ERROR', + \Analog\Analog::ALERT => 'ERROR', + \Analog\Analog::URGENT => 'ERROR' + ); + + /** + * Message index increases by 1 each time a message is sent. + */ + private static $message_index = 1; + + /** + * Formats a log header to be sent. + */ + public static function format_header ($info) { + if (is_array ($info['message'])) { + $extra = array ( + 'Type' => self::$log_levels[$info['level']], + 'File' => $info['message'][1], + 'Line' => $info['message'][2] + ); + $info['message'] = $info['message'][0]; + } else { + $extra = array ('Type' => self::$log_levels[$info['level']]); + } + + $json = json_encode (array ($extra, $info['message'])); + + return sprintf ('X-Wf-1-1-1-%d: %s|%s|', self::$message_index++, strlen ($json), $json); + } + + /** + * Sends the initial headers if FirePHP is available then returns a + * closure that handles sending log messages. + */ + public static function init () { + if (! isset ($_SERVER['HTTP_USER_AGENT']) + || preg_match ('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT']) + || isset ($_SERVER['HTTP_X_FIREPHP_VERSION'])) { + + header ('X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2'); + header ('X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'); + header ('X-Wf-1-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'); + } + + return function ($info) { + header (FirePHP::format_header ($info)); + }; + } +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog/Handler/GELF.php b/vendor/analog/analog/lib/Analog/Handler/GELF.php new file mode 100644 index 00000000..f1c580b2 --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/GELF.php @@ -0,0 +1,48 @@ +setHost ($info['machine']); + $message->setLevel ($info['level']); + + if (is_array ($info['message'])) { + $message->setShortMessage ($info['message'][0]); + $message->setFullMessage ($info['message'][0]); + $message->setFile ($info['message'][1]); + $message->setLine ($info['message'][2]); + } else { + $message->setShortMessage ($info['message']); + $message->setFullMessage ($info['message']); + } + + $publisher->publish ($message); + }; + } +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog/Handler/Ignore.php b/vendor/analog/analog/lib/Analog/Handler/Ignore.php new file mode 100644 index 00000000..57c67b5d --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Ignore.php @@ -0,0 +1,20 @@ + 'DEBUG', + \Analog\Analog::INFO => 'INFO', + \Analog\Analog::NOTICE => 'NOTICE', + \Analog\Analog::WARNING => 'WARNING', + \Analog\Analog::ERROR => 'ERROR', + \Analog\Analog::CRITICAL => 'CRITICAL', + \Analog\Analog::ALERT => 'ALERT', + \Analog\Analog::URGENT => 'URGENT' + ); + + /** + * This contains the handler to send to + */ + public static $handler; + + public static function init ($handler) { + self::$handler = $handler; + + return function ($info) { + if (isset(self::$log_levels[$info['level']])) { + $info['level'] = self::$log_levels[$info['level']]; + } + $handler = LevelName::$handler; + $handler ($info); + }; + } + +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog/Handler/Mail.php b/vendor/analog/analog/lib/Analog/Handler/Mail.php new file mode 100644 index 00000000..353ec0f5 --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Mail.php @@ -0,0 +1,28 @@ +{$database}; + } else { + if (class_exists('\MongoDB\Driver\Manager')) { + $driver = 'mongodb'; + $manager = new \MongoDB\Driver\Manager("mongodb://$server"); + } else { + $conn = new \MongoClient ("mongodb://$server"); + $db = $conn->{$database}; + } + } + if ($driver == 'mongodb') { + return function ($info) use ($manager, $database, $collection) { + $bulk = new \MongoDB\Driver\BulkWrite; + $bulk->insert($info); + $dbAndColl = $database.'.'.$collection; + $manager->executeBulkWrite($dbAndColl, $bulk); + }; + } else { + return function ($info) use ($db, $collection) { + $db->{$collection}->insert ($info); + }; + } + } +} diff --git a/vendor/analog/analog/lib/Analog/Handler/Multi.php b/vendor/analog/analog/lib/Analog/Handler/Multi.php new file mode 100644 index 00000000..332e5eda --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Multi.php @@ -0,0 +1,55 @@ + array( + * Analog\Handler\Mail::init( $to, $subject, $from ), + * Analog\Handler\Stderr::init() + * ), + * + * // Warnings are sent here + * Analog::WARNING => Analog\Handler\File::init( 'logs/warnings.log' ), + * + * // Debug and info messages sent here + * Analog::DEBUG => Analog\Handler\Ignore::init() // do nothing + * ) ) ); + * + * // will be ignored + * Analog::log ('Ignore me', Analog::DEBUG); + * + * // will be written to logs/warnings.log + * Analog::log ('Log me', Analog::WARNING); + * + * // will trigger an email notice + * Analog::log ('Uh oh...', Analog::ERROR); + */ +class Multi { + public static function init ($handlers) { + return function ($info) use ($handlers) { + $level = is_numeric ($info['level']) ? $info['level'] : 3; + while ($level <= 7) { + if ( isset ( $handlers[ $level ] ) ) { + + if ( ! is_array( $handlers[ $level ] ) ) { + $handlers[ $level ] = array( $handlers[ $level ] ); + } + + foreach ( $handlers[ $level ] as $handler ) { + $handler( $info ); + } + + return; + } + $level++; + } + }; + } +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/Analog/Handler/Post.php b/vendor/analog/analog/lib/Analog/Handler/Post.php new file mode 100644 index 00000000..321d64d4 --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Post.php @@ -0,0 +1,46 @@ + LOG_DEBUG, + \Analog\Analog::INFO => LOG_INFO, + \Analog\Analog::NOTICE => LOG_NOTICE, + \Analog\Analog::WARNING => LOG_WARNING, + \Analog\Analog::ERROR => LOG_ERR, + \Analog\Analog::CRITICAL => LOG_CRIT, + \Analog\Analog::ALERT => LOG_ALERT, + \Analog\Analog::URGENT => LOG_EMERG + ); + + public static $facilities = array ( + 'auth' => LOG_AUTH, + 'authpriv' => LOG_AUTHPRIV, + 'cron' => LOG_CRON, + 'daemon' => LOG_DAEMON, + 'kern' => LOG_KERN, + 'lpr' => LOG_LPR, + 'mail' => LOG_MAIL, + 'news' => LOG_NEWS, + 'syslog' => LOG_SYSLOG, + 'user' => LOG_USER, + 'uucp' => LOG_UUCP + ); + + public static function init ($ident, $facility) { + if (! defined ('PHP_WINDOWS_VERSION_BUILD')) { + self::$facilities['local0'] = LOG_LOCAL0; + self::$facilities['local1'] = LOG_LOCAL1; + self::$facilities['local2'] = LOG_LOCAL2; + self::$facilities['local3'] = LOG_LOCAL3; + self::$facilities['local4'] = LOG_LOCAL4; + self::$facilities['local5'] = LOG_LOCAL5; + self::$facilities['local6'] = LOG_LOCAL6; + self::$facilities['local7'] = LOG_LOCAL7; + } + + if (array_key_exists (strtolower ($facility), self::$facilities)) { + $facility = self::$facilities[strtolower ($facility)]; + } elseif (! in_array ($facility, array_values (self::$facilities), true)) { + throw new \UnexpectedValueException ('Unknown facility value "' . $facility . '"'); + } + + return function ($info) use ($ident, $facility) { + if (! openlog ($ident, LOG_PID, $facility)) { + throw new \LogicException ('Can\'t open syslog for ident "' . $ident . '" and facility "' . $facility . '"'); + } + + syslog (Syslog::$levels[$info['level']], vsprintf ('%1$s: %4$s', $info)); + + closelog (); + }; + } +} diff --git a/vendor/analog/analog/lib/Analog/Handler/Threshold.php b/vendor/analog/analog/lib/Analog/Handler/Threshold.php new file mode 100644 index 00000000..f435cbf1 --- /dev/null +++ b/vendor/analog/analog/lib/Analog/Handler/Threshold.php @@ -0,0 +1,45 @@ +notice ('Things are really happening right now.'); + * + * ?> + * + * @package Analog + * @author Johnny Broadway + */ +class Logger implements LoggerInterface { + /** + * Converts from PSR-3 log levels to Analog log levels. + */ + public function convert_log_level ($level, $reverse = false) { + if ($reverse) { + switch ($level) { + case Analog::URGENT: + return LogLevel::EMERGENCY; + case Analog::ALERT: + return LogLevel::ALERT; + case Analog::CRITICAL: + return LogLevel::CRITICAL; + case Analog::ERROR: + return LogLevel::ERROR; + case Analog::WARNING: + return LogLevel::WARNING; + case Analog::NOTICE: + return LogLevel::NOTICE; + case Analog::INFO: + return LogLevel::INFO; + case Analog::DEBUG: + return LogLevel::DEBUG; + } + throw new InvalidArgumentException ('Level "' . $level . '" is not defined.'); + } else { + switch ($level) { + case LogLevel::EMERGENCY: + return Analog::URGENT; + case LogLevel::ALERT: + return Analog::ALERT; + case LogLevel::CRITICAL: + return Analog::CRITICAL; + case LogLevel::ERROR: + return Analog::ERROR; + case LogLevel::WARNING: + return Analog::WARNING; + case LogLevel::NOTICE: + return Analog::NOTICE; + case LogLevel::INFO: + return Analog::INFO; + case LogLevel::DEBUG: + return Analog::DEBUG; + } + throw new InvalidArgumentException ('Level "' . $level . '" is not defined.'); + } + } + + /** + * Interpolates context values into the message placeholders. + */ + private function interpolate ($message, array $context = array ()) { + if (is_array ($message)) { + return $message; + } + + // build a replacement array with braces around the context keys + $replace = array (); + foreach ($context as $key => $val) { + if (is_object ($val) && get_class ($val) === 'DateTime') { + $val = $val->format ('Y-m-d H:i:s'); + } elseif (is_object ($val)) { + $val = json_encode ($val); + } elseif (is_array ($val)) { + $val = json_encode ($val); + } elseif (is_resource ($val)) { + $val = (string) $val; + } + $replace['{' . $key . '}'] = $val; + } + + // interpolate replacement values into the the message and return + return strtr ($message, $replace); + } + + /** + * Sets the Analog log handler. + */ + public function handler ($handler) { + Analog::handler ($handler); + } + + /** + * Sets the log message format. + */ + public function format ($format) { + Analog::$format = $format; + } + + /** + * System is unusable. + */ + public function emergency ($message, array $context = array ()) { + $this->_log (Analog::URGENT, $message, $context); + } + + /** + * Action must be taken immediately. + */ + public function alert ($message, array $context = array ()) { + $this->_log (Analog::ALERT, $message, $context); + } + + /** + * Critical conditions. + */ + public function critical ($message, array $context = array ()) { + $this->_log (Analog::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + */ + public function error ($message, array $context = array ()) { + $this->_log (Analog::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + */ + public function warning ($message, array $context = array ()) { + $this->_log (Analog::WARNING, $message, $context); + } + + /** + * Normal but significant events. + */ + public function notice ($message, array $context = array ()) { + $this->_log (Analog::NOTICE, $message, $context); + } + + /** + * Interesting events. + */ + public function info ($message, array $context = array ()) { + $this->_log (Analog::INFO, $message, $context); + } + + /** + * Detailed debug information. + */ + public function debug ($message, array $context = array ()) { + $this->_log (Analog::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + */ + public function log ($level, $message, array $context = array ()) { + $this->_log ( + $this->convert_log_level ($level), + $message, + $context + ); + } + + /** + * Perform the logging to Analog after the log level has been converted. + */ + private function _log ($level, $message, $context) { + Analog::log ( + $this->interpolate ($message, $context), + $level + ); + } +} \ No newline at end of file diff --git a/vendor/analog/analog/lib/ChromePhp.php b/vendor/analog/analog/lib/ChromePhp.php new file mode 100644 index 00000000..11d72c48 --- /dev/null +++ b/vendor/analog/analog/lib/ChromePhp.php @@ -0,0 +1,423 @@ + + */ +class ChromePhp +{ + /** + * @var string + */ + const VERSION = '4.0.0'; + + /** + * @var string + */ + const HEADER_NAME = 'X-ChromeLogger-Data'; + + /** + * @var string + */ + const BACKTRACE_LEVEL = 'backtrace_level'; + + /** + * @var string + */ + const LOG = 'log'; + + /** + * @var string + */ + const WARN = 'warn'; + + /** + * @var string + */ + const ERROR = 'error'; + + /** + * @var string + */ + const GROUP = 'group'; + + /** + * @var string + */ + const INFO = 'info'; + + /** + * @var string + */ + const GROUP_END = 'groupEnd'; + + /** + * @var string + */ + const GROUP_COLLAPSED = 'groupCollapsed'; + + /** + * @var string + */ + protected $_php_version; + + /** + * @var int + */ + protected $_timestamp; + + /** + * @var array + */ + protected $_json = array( + 'version' => self::VERSION, + 'columns' => array('log', 'backtrace', 'type'), + 'rows' => array() + ); + + /** + * @var array + */ + protected $_backtraces = array(); + + /** + * @var bool + */ + protected $_error_triggered = false; + + /** + * @var array + */ + protected $_settings = array( + self::BACKTRACE_LEVEL => 1 + ); + + /** + * @var ChromePhp + */ + protected static $_instance; + + /** + * Prevent recursion when working with objects referring to each other + * + * @var array + */ + protected $_processed = array(); + + /** + * constructor + */ + private function __construct() + { + $this->_php_version = phpversion(); + $this->_timestamp = $this->_php_version >= 5.1 ? $_SERVER['REQUEST_TIME'] : time(); + $this->_json['request_uri'] = $_SERVER['REQUEST_URI']; + } + + /** + * gets instance of this class + * + * @return ChromePhp + */ + public static function getInstance() + { + if (self::$_instance === null) { + self::$_instance = new self(); + } + return self::$_instance; + } + + /** + * logs a variable to the console + * + * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] + * @return void + */ + public static function log() + { + return self::_log('', func_get_args()); + } + + /** + * logs a warning to the console + * + * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] + * @return void + */ + public static function warn() + { + return self::_log(self::WARN, func_get_args()); + } + + /** + * logs an error to the console + * + * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] + * @return void + */ + public static function error() + { + return self::_log(self::ERROR, func_get_args()); + } + + /** + * sends a group log + * + * @param string value + */ + public static function group() + { + return self::_log(self::GROUP, func_get_args()); + } + + /** + * sends an info log + * + * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] + * @return void + */ + public static function info() + { + return self::_log(self::INFO, func_get_args()); + } + + /** + * sends a collapsed group log + * + * @param string value + */ + public static function groupCollapsed() + { + return self::_log(self::GROUP_COLLAPSED, func_get_args()); + } + + /** + * ends a group log + * + * @param string value + */ + public static function groupEnd() + { + return self::_log(self::GROUP_END, func_get_args()); + } + + /** + * internal logging call + * + * @param string $type + * @return void + */ + protected static function _log($type, array $args) + { + // nothing passed in, don't do anything + if (count($args) == 0 && $type != self::GROUP_END) { + return; + } + + $logger = self::getInstance(); + + $logger->_processed = array(); + + $logs = array(); + foreach ($args as $arg) { + $logs[] = $logger->_convert($arg); + } + + $backtrace = debug_backtrace(false); + $level = $logger->getSetting(self::BACKTRACE_LEVEL); + + $backtrace_message = 'unknown'; + if (isset($backtrace[$level]['file']) && isset($backtrace[$level]['line'])) { + $backtrace_message = $backtrace[$level]['file'] . ' : ' . $backtrace[$level]['line']; + } + + $logger->_addRow($logs, $backtrace_message, $type); + } + + /** + * converts an object to a better format for logging + * + * @param Object + * @return array + */ + protected function _convert($object) + { + // if this isn't an object then just return it + if (!is_object($object)) { + return $object; + } + + //Mark this object as processed so we don't convert it twice and it + //Also avoid recursion when objects refer to each other + $this->_processed[] = $object; + + $object_as_array = array(); + + // first add the class name + $object_as_array['___class_name'] = get_class($object); + + // loop through object vars + $object_vars = get_object_vars($object); + foreach ($object_vars as $key => $value) { + + // same instance as parent object + if ($value === $object || in_array($value, $this->_processed, true)) { + $value = 'recursion - parent object [' . get_class($value) . ']'; + } + $object_as_array[$key] = $this->_convert($value); + } + + $reflection = new ReflectionClass($object); + + // loop through the properties and add those + foreach ($reflection->getProperties() as $property) { + + // if one of these properties was already added above then ignore it + if (array_key_exists($property->getName(), $object_vars)) { + continue; + } + $type = $this->_getPropertyKey($property); + + if ($this->_php_version >= 5.3) { + $property->setAccessible(true); + } + + try { + $value = $property->getValue($object); + } catch (ReflectionException $e) { + $value = 'only PHP 5.3 can access private/protected properties'; + } + + // same instance as parent object + if ($value === $object || in_array($value, $this->_processed, true)) { + $value = 'recursion - parent object [' . get_class($value) . ']'; + } + + $object_as_array[$type] = $this->_convert($value); + } + return $object_as_array; + } + + /** + * takes a reflection property and returns a nicely formatted key of the property name + * + * @param ReflectionProperty + * @return string + */ + protected function _getPropertyKey(ReflectionProperty $property) + { + $static = $property->isStatic() ? ' static' : ''; + if ($property->isPublic()) { + return 'public' . $static . ' ' . $property->getName(); + } + + if ($property->isProtected()) { + return 'protected' . $static . ' ' . $property->getName(); + } + + if ($property->isPrivate()) { + return 'private' . $static . ' ' . $property->getName(); + } + } + + /** + * adds a value to the data array + * + * @var mixed + * @return void + */ + protected function _addRow(array $logs, $backtrace, $type) + { + // if this is logged on the same line for example in a loop, set it to null to save space + if (in_array($backtrace, $this->_backtraces)) { + $backtrace = null; + } + + // for group, groupEnd, and groupCollapsed + // take out the backtrace since it is not useful + if ($type == self::GROUP || $type == self::GROUP_END || $type == self::GROUP_COLLAPSED) { + $backtrace = null; + } + + if ($backtrace !== null) { + $this->_backtraces[] = $backtrace; + } + + $row = array($logs, $backtrace, $type); + + $this->_json['rows'][] = $row; + $this->_writeHeader($this->_json); + } + + protected function _writeHeader($data) + { + header(self::HEADER_NAME . ': ' . $this->_encode($data)); + } + + /** + * encodes the data to be sent along with the request + * + * @param array $data + * @return string + */ + protected function _encode($data) + { + return base64_encode(utf8_encode(json_encode($data))); + } + + /** + * adds a setting + * + * @param string key + * @param mixed value + * @return void + */ + public function addSetting($key, $value) + { + $this->_settings[$key] = $value; + } + + /** + * add ability to set multiple settings in one call + * + * @param array $settings + * @return void + */ + public function addSettings(array $settings) + { + foreach ($settings as $key => $value) { + $this->addSetting($key, $value); + } + } + + /** + * gets a setting + * + * @param string key + * @return mixed + */ + public function getSetting($key) + { + if (!isset($this->_settings[$key])) { + return null; + } + return $this->_settings[$key]; + } +} \ No newline at end of file diff --git a/vendor/analog/analog/phpunit.xml.dist b/vendor/analog/analog/phpunit.xml.dist new file mode 100644 index 00000000..4761a2ae --- /dev/null +++ b/vendor/analog/analog/phpunit.xml.dist @@ -0,0 +1,19 @@ + + + + + + ./tests + + + diff --git a/vendor/analog/analog/tests/AnalogTest.php b/vendor/analog/analog/tests/AnalogTest.php new file mode 100644 index 00000000..1f42dcde --- /dev/null +++ b/vendor/analog/analog/tests/AnalogTest.php @@ -0,0 +1,176 @@ +assertStringMatchesFormat ( + "localhost - %d-%d-%d %d:%d:%d - 3 - Foo\n", + file_get_contents (Analog::handler ()) + ); + unlink (Analog::handler ()); + } + + /** + * @depends test_default + */ + function test_format () { + // Test changing the format string and write again + Analog::$format = "%s, %s, %d, %s\n"; + Analog::log ('Foo'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 3, Foo\n", + file_get_contents (Analog::handler ()) + ); + unlink (Analog::handler ()); + } + + /** + * @depends test_format + */ + function test_tz_and_dates () { + // Test changing the date_format + Analog::$date_format = 'r'; // RFC2822 format + Analog::log ('Foo'); + $this->assertStringMatchesFormat ( + "localhost, %s, %d %s %d %d:%d:%d +0000, 3, Foo\n", + file_get_contents (Analog::handler ()) + ); + unlink (Analog::handler ()); + + // Test changing the timezone + Analog::$timezone = 'CST'; + Analog::log ('Foo'); + + $dt = new \DateTime ('now', new \DateTimeZone (Analog::$timezone)); + $zone_offset = $dt->format ('O'); + + $this->assertStringMatchesFormat ( + "localhost, %s, %d %s %d %d:%d:%d $zone_offset, 3, Foo\n", + file_get_contents (Analog::handler ()) + ); + unlink (Analog::handler ()); + + Analog::$date_format = 'Y-m-d H:i:s'; + Analog::$timezone = 'GMT'; + } + + /** + * @depends test_tz_and_dates + */ + function test_handler () { + // Test logging using a closure + Analog::handler (function ($msg) { + AnalogTest::$log .= vsprintf (Analog::$format, $msg); + }); + + Analog::log ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 3, Testing\n", + self::$log + ); + + self::$log = ''; + } + + /** + * @depends test_handler + */ + function test_level () { + // Test default_level change + Analog::$default_level = 1; + Analog::log ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 1, Testing\n", + self::$log + ); + + Analog::$default_level = 3; + } + + /* + * @depends test_level + * @covers Analog::urgent + * @covers Analog::alert + * @covers Analog::critical + * @covers Analog::error + * @covers Analog::warning + * @covers Analog::notice + * @covers Analog::info + * @covers Analog::debug + */ + function test_aliases () { + self::$log = ''; + + Analog::urgent ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 0, Testing\n", + self::$log + ); + + self::$log = ''; + + Analog::alert ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 1, Testing\n", + self::$log + ); + + self::$log = ''; + + Analog::error ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 3, Testing\n", + self::$log + ); + + self::$log = ''; + + Analog::warning ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 4, Testing\n", + self::$log + ); + + self::$log = ''; + + Analog::notice ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 5, Testing\n", + self::$log + ); + + self::$log = ''; + + Analog::info ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 6, Testing\n", + self::$log + ); + + self::$log = ''; + + Analog::debug ('Testing'); + $this->assertStringMatchesFormat ( + "localhost, %d-%d-%d %d:%d:%d, 7, Testing\n", + self::$log + ); + + self::$log = ''; + } +} + +?> diff --git a/vendor/analog/analog/tests/PHPUnit_Framework_TestCase.php b/vendor/analog/analog/tests/PHPUnit_Framework_TestCase.php new file mode 100644 index 00000000..21342149 --- /dev/null +++ b/vendor/analog/analog/tests/PHPUnit_Framework_TestCase.php @@ -0,0 +1,5 @@ +handler (Variable::init ($this->log)); + $logger->format ("%3\$d %4\$s\n"); + return $logger; + } + + public function getLogs () { + $logger = $this->getLogger (); + + $logs = explode ("\n", trim ($this->log)); + + foreach ($logs as $key => $line) { + list ($level, $msg) = explode (' ', $line, 2); + $logs[$key] = $logger->convert_log_level ((int) $level, true) . ' ' . $msg; + } + + return $logs; + } +} \ No newline at end of file diff --git a/vendor/analog/analog/tests/bootstrap.php b/vendor/analog/analog/tests/bootstrap.php new file mode 100644 index 00000000..a2a61b73 --- /dev/null +++ b/vendor/analog/analog/tests/bootstrap.php @@ -0,0 +1,8 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..7a91153b --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,9 @@ + $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..3d9790c1 --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,11 @@ + array($vendorDir . '/mailjet/mailjet-apiv3-php/src'), + 'Analog' => array($vendorDir . '/analog/analog/lib'), +); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php new file mode 100644 index 00000000..e837b23b --- /dev/null +++ b/vendor/composer/autoload_psr4.php @@ -0,0 +1,26 @@ + array($vendorDir . '/symfony/polyfill-mbstring'), + 'Sepia\\Test\\' => array($vendorDir . '/sepia/po-parser/tests'), + 'Sepia\\PoParser\\' => array($vendorDir . '/sepia/po-parser/src'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), + 'MailjetPlugin\\Widget\\' => array($baseDir . '/src/widget'), + 'MailjetPlugin\\Includes\\SettingsPages\\' => array($baseDir . '/src/includes/SettingsPages'), + 'MailjetPlugin\\Includes\\' => array($baseDir . '/src/includes'), + 'MailjetPlugin\\Front\\' => array($baseDir . '/src/front'), + 'MailjetPlugin\\Admin\\Partials\\' => array($baseDir . '/src/admin/partials'), + 'MailjetPlugin\\Admin\\' => array($baseDir . '/src/admin'), + 'MailjetPlugin\\' => array($baseDir . '/src'), + 'MailjetIframe\\' => array($vendorDir . '/mailjet/Mailjet-iframe-v3/src'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 00000000..680df53f --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,70 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit073753720e09a5e433c92da9ecf0ce4a::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit073753720e09a5e433c92da9ecf0ce4a::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire073753720e09a5e433c92da9ecf0ce4a($fileIdentifier, $file); + } + + return $loader; + } +} + +function composerRequire073753720e09a5e433c92da9ecf0ce4a($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 00000000..91719fdd --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,149 @@ + __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'S' => + array ( + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Sepia\\Test\\' => 11, + 'Sepia\\PoParser\\' => 15, + ), + 'P' => + array ( + 'Psr\\Log\\' => 8, + 'Psr\\Http\\Message\\' => 17, + ), + 'M' => + array ( + 'MailjetPlugin\\Widget\\' => 21, + 'MailjetPlugin\\Includes\\SettingsPages\\' => 37, + 'MailjetPlugin\\Includes\\' => 23, + 'MailjetPlugin\\Front\\' => 20, + 'MailjetPlugin\\Admin\\Partials\\' => 29, + 'MailjetPlugin\\Admin\\' => 20, + 'MailjetPlugin\\' => 14, + 'MailjetIframe\\' => 14, + ), + 'G' => + array ( + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + ), + 'C' => + array ( + 'Composer\\Installers\\' => 20, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Sepia\\Test\\' => + array ( + 0 => __DIR__ . '/..' . '/sepia/po-parser/tests', + ), + 'Sepia\\PoParser\\' => + array ( + 0 => __DIR__ . '/..' . '/sepia/po-parser/src', + ), + 'Psr\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + ), + 'Psr\\Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-message/src', + ), + 'MailjetPlugin\\Widget\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/widget', + ), + 'MailjetPlugin\\Includes\\SettingsPages\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/includes/SettingsPages', + ), + 'MailjetPlugin\\Includes\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/includes', + ), + 'MailjetPlugin\\Front\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/front', + ), + 'MailjetPlugin\\Admin\\Partials\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/admin/partials', + ), + 'MailjetPlugin\\Admin\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/admin', + ), + 'MailjetPlugin\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + ), + 'MailjetIframe\\' => + array ( + 0 => __DIR__ . '/..' . '/mailjet/Mailjet-iframe-v3/src', + ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Composer\\Installers\\' => + array ( + 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', + ), + ); + + public static $prefixesPsr0 = array ( + 'M' => + array ( + 'Mailjet' => + array ( + 0 => __DIR__ . '/..' . '/mailjet/mailjet-apiv3-php/src', + ), + ), + 'A' => + array ( + 'Analog' => + array ( + 0 => __DIR__ . '/..' . '/analog/analog/lib', + ), + ), + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit073753720e09a5e433c92da9ecf0ce4a::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit073753720e09a5e433c92da9ecf0ce4a::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit073753720e09a5e433c92da9ecf0ce4a::$prefixesPsr0; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 00000000..a838bfb7 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,741 @@ +[ + { + "name": "analog/analog", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/jbroadway/analog.git", + "reference": "f04906be5a740794959ecceaaae307792cfe3b58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jbroadway/analog/zipball/f04906be5a740794959ecceaaae307792cfe3b58", + "reference": "f04906be5a740794959ecceaaae307792cfe3b58", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "psr/log": "1.*" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" + }, + "time": "2018-12-08T15:36:38+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Analog": "lib/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Johnny Broadway", + "email": "johnny@johnnybroadway.com", + "homepage": "http://www.johnnybroadway.com/" + } + ], + "description": "PHP logging class that can be extended via closures. Includes several pre-built handlers including file, mail, syslog, HTTP post, and MongoDB.", + "homepage": "https://github.com/jbroadway/analog", + "keywords": [ + "alerts", + "debug", + "debugging", + "error", + "log", + "logger", + "logging", + "syslog" + ], + "support": { + "source": "https://github.com/jbroadway/analog/tree/1.0.11-stable", + "issues": "https://github.com/jbroadway/analog/issues" + } + }, + { + "name": "composer/installers", + "version": "v1.6.0", + "version_normalized": "1.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "^4.8.36" + }, + "time": "2018-08-27T06:10:37+00:00", + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ] + }, + { + "name": "guzzlehttp/guzzle", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9799bbcb90ed2df488adb0924169163156483e52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9799bbcb90ed2df488adb0924169163156483e52", + "reference": "9799bbcb90ed2df488adb0924169163156483e52", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "time": "2018-12-07T08:18:25+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ] + }, + { + "name": "guzzlehttp/promises", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "926eaa3ff73cde2becf652b785831bcb7618568a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/926eaa3ff73cde2becf652b785831bcb7618568a", + "reference": "926eaa3ff73cde2becf652b785831bcb7618568a", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "time": "2018-10-30T00:20:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ] + }, + { + "name": "guzzlehttp/psr7", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "5e61346ab1e1ca7d01d2f633bad9574d35717781" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/5e61346ab1e1ca7d01d2f633bad9574d35717781", + "reference": "5e61346ab1e1ca7d01d2f633bad9574d35717781", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2018-12-07T15:04:46+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ] + }, + { + "name": "mailjet/Mailjet-iframe-v3", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "git@github.com:mailjet/Mailjet-iframe-v3.git", + "reference": "c7e5c5b98e76f1501b4a90d869e83934c0137234" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mailjet/Mailjet-iframe-v3/zipball/c7e5c5b98e76f1501b4a90d869e83934c0137234", + "reference": "c7e5c5b98e76f1501b4a90d869e83934c0137234", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "time": "2018-11-19T08:24:34+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MailjetIframe\\": "src" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mailjet", + "email": "dev@mailjet.com", + "homepage": "https://dev.mailjet.com" + } + ], + "description": "Mailjet iFrame wrapper", + "homepage": "https://github.com/mailjet/Mailjet-iframe-v3/", + "keywords": [ + "api", + "campaign", + "email", + "iframe", + "mailjet", + "marketing", + "php" + ], + "support": { + "source": "https://github.com/mailjet/Mailjet-iframe-v3/tree/master", + "issues": "https://github.com/mailjet/Mailjet-iframe-v3/issues" + } + }, + { + "name": "mailjet/mailjet-apiv3-php", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/mailjet/mailjet-apiv3-php.git", + "reference": "9d89b9a424a9631bff8e499cbbe34058481e8102" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mailjet/mailjet-apiv3-php/zipball/9d89b9a424a9631bff8e499cbbe34058481e8102", + "reference": "9d89b9a424a9631bff8e499cbbe34058481e8102", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0|~5.3", + "php": ">=5.4.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^4.8" + }, + "time": "2018-10-31T13:24:45+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Mailjet": "src/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mailjet", + "email": "dev@mailjet.com", + "homepage": "https://dev.mailjet.com" + } + ], + "description": "PHP wrapper for the Mailjet API", + "homepage": "https://github.com/mailjet/mailjet-apiv3-php/", + "keywords": [ + "api", + "email", + "mailjet", + "php", + "v3" + ], + "support": { + "source": "https://github.com/mailjet/mailjet-apiv3-php/tree/v1.4.1", + "issues": "https://github.com/mailjet/mailjet-apiv3-php/issues" + } + }, + { + "name": "psr/http-message", + "version": "dev-master", + "version_normalized": "9999999-dev", + "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" + }, + "time": "2016-08-06T14:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "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" + ] + }, + { + "name": "psr/log", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "c4421fcac1edd5a324fda73e589a5cf96e52ffd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/c4421fcac1edd5a324fda73e589a5cf96e52ffd0", + "reference": "c4421fcac1edd5a324fda73e589a5cf96e52ffd0", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2018-11-21T13:42:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ] + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "version_normalized": "2.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "time": "2016-02-11T07:05:27+00:00", + "type": "library", + "installation-source": "dist", + "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." + }, + { + "name": "sepia/po-parser", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/raulferras/PHP-po-parser.git", + "reference": "ab59aeed9cf3a125caba313dd8d1e9124d3ba9c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/raulferras/PHP-po-parser/zipball/ab59aeed9cf3a125caba313dd8d1e9124d3ba9c0", + "reference": "ab59aeed9cf3a125caba313dd8d1e9124d3ba9c0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "symfony/polyfill-mbstring": "^1" + }, + "require-dev": { + "fzaninotto/faker": "^1.7", + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^2.0" + }, + "time": "2018-07-27T14:37:11+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Sepia\\PoParser\\": "src/", + "Sepia\\Test\\": "tests/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raúl Ferràs", + "email": "raul.ferras@gmail.com", + "role": "developer" + } + ], + "description": "Gettext *.PO file parser for PHP.", + "homepage": "https://github.com/raulferras/PHP-po-parser", + "keywords": [ + "gettext", + "i10n", + "i18n", + "po" + ], + "support": { + "issues": "https://github.com/raulferras/PHP-po-parser/issues", + "source": "https://github.com/raulferras/PHP-po-parser/tree/master" + } + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "version_normalized": "1.10.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2018-09-21T13:07:52+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ] + } +] diff --git a/vendor/composer/installers/LICENSE b/vendor/composer/installers/LICENSE new file mode 100644 index 00000000..85f97fc7 --- /dev/null +++ b/vendor/composer/installers/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Kyle Robinson Young + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/vendor/composer/installers/composer.json b/vendor/composer/installers/composer.json new file mode 100644 index 00000000..6de40853 --- /dev/null +++ b/vendor/composer/installers/composer.json @@ -0,0 +1,105 @@ +{ + "name": "composer/installers", + "type": "composer-plugin", + "license": "MIT", + "description": "A multi-framework Composer library installer", + "keywords": [ + "installer", + "Aimeos", + "AGL", + "AnnotateCms", + "Attogram", + "Bitrix", + "CakePHP", + "Chef", + "Cockpit", + "CodeIgniter", + "concrete5", + "Craft", + "Croogo", + "DokuWiki", + "Dolibarr", + "Drupal", + "Elgg", + "Eliasis", + "ExpressionEngine", + "eZ Platform", + "FuelPHP", + "Grav", + "Hurad", + "ImageCMS", + "iTop", + "Joomla", + "Kanboard", + "Kohana", + "Lan Management System", + "Laravel", + "Lavalite", + "Lithium", + "Magento", + "majima", + "Mako", + "Mautic", + "Maya", + "MODX", + "MODX Evo", + "MediaWiki", + "OXID", + "osclass", + "MODULEWork", + "Moodle", + "Piwik", + "pxcms", + "phpBB", + "Plentymarkets", + "PPI", + "Puppet", + "Porto", + "RadPHP", + "ReIndex", + "Roundcube", + "shopware", + "SilverStripe", + "SMF", + "SyDES", + "symfony", + "Thelia", + "TYPO3", + "WolfCMS", + "WordPress", + "YAWIK", + "Zend", + "Zikula" + ], + "homepage": "https://composer.github.io/installers/", + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "autoload": { + "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" } + }, + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "replace": { + "shama/baton": "*", + "roundcube/plugin-installer": "*" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "^4.8.36" + }, + "scripts": { + "test": "phpunit" + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/AglInstaller.php b/vendor/composer/installers/src/Composer/Installers/AglInstaller.php new file mode 100644 index 00000000..01b8a416 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/AglInstaller.php @@ -0,0 +1,21 @@ + 'More/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) { + return strtoupper($matches[1]); + }, $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php b/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php new file mode 100644 index 00000000..79a0e958 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php @@ -0,0 +1,9 @@ + 'ext/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php b/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php new file mode 100644 index 00000000..89d7ad90 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php @@ -0,0 +1,11 @@ + 'addons/modules/{$name}/', + 'component' => 'addons/components/{$name}/', + 'service' => 'addons/services/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php b/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php new file mode 100644 index 00000000..22dad1b9 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php @@ -0,0 +1,49 @@ + 'Modules/{$name}/', + 'theme' => 'Themes/{$name}/' + ); + + /** + * Format package name. + * + * For package type asgard-module, cut off a trailing '-plugin' if present. + * + * For package type asgard-theme, cut off a trailing '-theme' if present. + * + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'asgard-module') { + return $this->inflectPluginVars($vars); + } + + if ($vars['type'] === 'asgard-theme') { + return $this->inflectThemeVars($vars); + } + + return $vars; + } + + protected function inflectPluginVars($vars) + { + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } + + protected function inflectThemeVars($vars) + { + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php b/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php new file mode 100644 index 00000000..d62fd8fd --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php @@ -0,0 +1,9 @@ + 'modules/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php b/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php new file mode 100644 index 00000000..7082bf2c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php @@ -0,0 +1,136 @@ +composer = $composer; + $this->package = $package; + $this->io = $io; + } + + /** + * Return the install path based on package type. + * + * @param PackageInterface $package + * @param string $frameworkType + * @return string + */ + public function getInstallPath(PackageInterface $package, $frameworkType = '') + { + $type = $this->package->getType(); + + $prettyName = $this->package->getPrettyName(); + if (strpos($prettyName, '/') !== false) { + list($vendor, $name) = explode('/', $prettyName); + } else { + $vendor = ''; + $name = $prettyName; + } + + $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type')); + + $extra = $package->getExtra(); + if (!empty($extra['installer-name'])) { + $availableVars['name'] = $extra['installer-name']; + } + + if ($this->composer->getPackage()) { + $extra = $this->composer->getPackage()->getExtra(); + if (!empty($extra['installer-paths'])) { + $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor); + if ($customPath !== false) { + return $this->templatePath($customPath, $availableVars); + } + } + } + + $packageType = substr($type, strlen($frameworkType) + 1); + $locations = $this->getLocations(); + if (!isset($locations[$packageType])) { + throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type)); + } + + return $this->templatePath($locations[$packageType], $availableVars); + } + + /** + * For an installer to override to modify the vars per installer. + * + * @param array $vars + * @return array + */ + public function inflectPackageVars($vars) + { + return $vars; + } + + /** + * Gets the installer's locations + * + * @return array + */ + public function getLocations() + { + return $this->locations; + } + + /** + * Replace vars in a path + * + * @param string $path + * @param array $vars + * @return string + */ + protected function templatePath($path, array $vars = array()) + { + if (strpos($path, '{') !== false) { + extract($vars); + preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches); + if (!empty($matches[1])) { + foreach ($matches[1] as $var) { + $path = str_replace('{$' . $var . '}', $$var, $path); + } + } + } + + return $path; + } + + /** + * Search through a passed paths array for a custom install path. + * + * @param array $paths + * @param string $name + * @param string $type + * @param string $vendor = NULL + * @return string + */ + protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL) + { + foreach ($paths as $path => $names) { + if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) { + return $path; + } + } + + return false; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php b/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php new file mode 100644 index 00000000..e80cd1e1 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php @@ -0,0 +1,126 @@ +.`. + * - `bitrix-d7-component` — copy the component to directory `bitrix/components//`. + * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/_`. + * + * You can set custom path to directory with Bitrix kernel in `composer.json`: + * + * ```json + * { + * "extra": { + * "bitrix-dir": "s1/bitrix" + * } + * } + * ``` + * + * @author Nik Samokhvalov + * @author Denis Kulichkin + */ +class BitrixInstaller extends BaseInstaller +{ + protected $locations = array( + 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) + 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) + 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken) + 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/', + 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/', + 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/', + ); + + /** + * @var array Storage for informations about duplicates at all the time of installation packages. + */ + private static $checkedDuplicates = array(); + + /** + * {@inheritdoc} + */ + public function inflectPackageVars($vars) + { + if ($this->composer->getPackage()) { + $extra = $this->composer->getPackage()->getExtra(); + + if (isset($extra['bitrix-dir'])) { + $vars['bitrix_dir'] = $extra['bitrix-dir']; + } + } + + if (!isset($vars['bitrix_dir'])) { + $vars['bitrix_dir'] = 'bitrix'; + } + + return parent::inflectPackageVars($vars); + } + + /** + * {@inheritdoc} + */ + protected function templatePath($path, array $vars = array()) + { + $templatePath = parent::templatePath($path, $vars); + $this->checkDuplicates($templatePath, $vars); + + return $templatePath; + } + + /** + * Duplicates search packages. + * + * @param string $path + * @param array $vars + */ + protected function checkDuplicates($path, array $vars = array()) + { + $packageType = substr($vars['type'], strlen('bitrix') + 1); + $localDir = explode('/', $vars['bitrix_dir']); + array_pop($localDir); + $localDir[] = 'local'; + $localDir = implode('/', $localDir); + + $oldPath = str_replace( + array('{$bitrix_dir}', '{$name}'), + array($localDir, $vars['name']), + $this->locations[$packageType] + ); + + if (in_array($oldPath, static::$checkedDuplicates)) { + return; + } + + if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) { + + $this->io->writeError(' Duplication of packages:'); + $this->io->writeError(' Package ' . $oldPath . ' will be called instead package ' . $path . ''); + + while (true) { + switch ($this->io->ask(' Delete ' . $oldPath . ' [y,n,?]? ', '?')) { + case 'y': + $fs = new Filesystem(); + $fs->removeDirectory($oldPath); + break 2; + + case 'n': + break 2; + + case '?': + default: + $this->io->writeError(array( + ' y - delete package ' . $oldPath . ' and to continue with the installation', + ' n - don\'t delete and to continue with the installation', + )); + $this->io->writeError(' ? - print help'); + break; + } + } + } + + static::$checkedDuplicates[] = $oldPath; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php b/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php new file mode 100644 index 00000000..da3aad2a --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php @@ -0,0 +1,9 @@ + 'Packages/{$vendor}/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php b/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php new file mode 100644 index 00000000..6352beb1 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php @@ -0,0 +1,82 @@ + 'Plugin/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + if ($this->matchesCakeVersion('>=', '3.0.0')) { + return $vars; + } + + $nameParts = explode('/', $vars['name']); + foreach ($nameParts as &$value) { + $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value)); + $value = str_replace(array('-', '_'), ' ', $value); + $value = str_replace(' ', '', ucwords($value)); + } + $vars['name'] = implode('/', $nameParts); + + return $vars; + } + + /** + * Change the default plugin location when cakephp >= 3.0 + */ + public function getLocations() + { + if ($this->matchesCakeVersion('>=', '3.0.0')) { + $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/'; + } + return $this->locations; + } + + /** + * Check if CakePHP version matches against a version + * + * @param string $matcher + * @param string $version + * @return bool + */ + protected function matchesCakeVersion($matcher, $version) + { + if (class_exists('Composer\Semver\Constraint\MultiConstraint')) { + $multiClass = 'Composer\Semver\Constraint\MultiConstraint'; + $constraintClass = 'Composer\Semver\Constraint\Constraint'; + } else { + $multiClass = 'Composer\Package\LinkConstraint\MultiConstraint'; + $constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint'; + } + + $repositoryManager = $this->composer->getRepositoryManager(); + if ($repositoryManager) { + $repos = $repositoryManager->getLocalRepository(); + if (!$repos) { + return false; + } + $cake3 = new $multiClass(array( + new $constraintClass($matcher, $version), + new $constraintClass('!=', '9999999-dev'), + )); + $pool = new Pool('dev'); + $pool->addRepository($repos); + $packages = $pool->whatProvides('cakephp/cakephp'); + foreach ($packages as $package) { + $installed = new $constraintClass('=', $package->getVersion()); + if ($cake3->matches($installed)) { + return true; + } + } + } + return false; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php b/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php new file mode 100644 index 00000000..ab2f9aad --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php @@ -0,0 +1,11 @@ + 'Chef/{$vendor}/{$name}/', + 'role' => 'Chef/roles/{$name}/', + ); +} + diff --git a/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php b/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php new file mode 100644 index 00000000..6673aea9 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php @@ -0,0 +1,9 @@ + 'ext/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php b/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php new file mode 100644 index 00000000..c887815c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php @@ -0,0 +1,10 @@ + 'CCF/orbit/{$name}/', + 'theme' => 'CCF/app/themes/{$name}/', + ); +} \ No newline at end of file diff --git a/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php b/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php new file mode 100644 index 00000000..c7816dfc --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php @@ -0,0 +1,34 @@ + 'cockpit/modules/addons/{$name}/', + ); + + /** + * Format module name. + * + * Strip `module-` prefix from package name. + * + * @param array @vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] == 'cockpit-module') { + return $this->inflectModuleVars($vars); + } + + return $vars; + } + + public function inflectModuleVars($vars) + { + $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php b/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php new file mode 100644 index 00000000..3b4a4ece --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php @@ -0,0 +1,11 @@ + 'application/libraries/{$name}/', + 'third-party' => 'application/third_party/{$name}/', + 'module' => 'application/modules/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php b/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php new file mode 100644 index 00000000..5c01bafd --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php @@ -0,0 +1,13 @@ + 'concrete/', + 'block' => 'application/blocks/{$name}/', + 'package' => 'packages/{$name}/', + 'theme' => 'application/themes/{$name}/', + 'update' => 'updates/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php b/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php new file mode 100644 index 00000000..d37a77ae --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php @@ -0,0 +1,35 @@ + 'craft/plugins/{$name}/', + ); + + /** + * Strip `craft-` prefix and/or `-plugin` suffix from package names + * + * @param array $vars + * + * @return array + */ + final public function inflectPackageVars($vars) + { + return $this->inflectPluginVars($vars); + } + + private function inflectPluginVars($vars) + { + $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']); + $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php b/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php new file mode 100644 index 00000000..d94219d3 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php @@ -0,0 +1,21 @@ + 'Plugin/{$name}/', + 'theme' => 'View/Themed/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name'])); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php b/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php new file mode 100644 index 00000000..f4837a6c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php @@ -0,0 +1,10 @@ + 'app/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php b/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php new file mode 100644 index 00000000..cfd638d5 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php @@ -0,0 +1,50 @@ + 'lib/plugins/{$name}/', + 'template' => 'lib/tpl/{$name}/', + ); + + /** + * Format package name. + * + * For package type dokuwiki-plugin, cut off a trailing '-plugin', + * or leading dokuwiki_ if present. + * + * For package type dokuwiki-template, cut off a trailing '-template' if present. + * + */ + public function inflectPackageVars($vars) + { + + if ($vars['type'] === 'dokuwiki-plugin') { + return $this->inflectPluginVars($vars); + } + + if ($vars['type'] === 'dokuwiki-template') { + return $this->inflectTemplateVars($vars); + } + + return $vars; + } + + protected function inflectPluginVars($vars) + { + $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']); + $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']); + + return $vars; + } + + protected function inflectTemplateVars($vars) + { + $vars['name'] = preg_replace('/-template$/', '', $vars['name']); + $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']); + + return $vars; + } + +} diff --git a/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php b/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php new file mode 100644 index 00000000..21f7e8e8 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php @@ -0,0 +1,16 @@ + + */ +class DolibarrInstaller extends BaseInstaller +{ + //TODO: Add support for scripts and themes + protected $locations = array( + 'module' => 'htdocs/custom/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php b/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php new file mode 100644 index 00000000..fef7c525 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php @@ -0,0 +1,16 @@ + 'core/', + 'module' => 'modules/{$name}/', + 'theme' => 'themes/{$name}/', + 'library' => 'libraries/{$name}/', + 'profile' => 'profiles/{$name}/', + 'drush' => 'drush/{$name}/', + 'custom-theme' => 'themes/custom/{$name}/', + 'custom-module' => 'modules/custom/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php b/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php new file mode 100644 index 00000000..c0bb609f --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php @@ -0,0 +1,9 @@ + 'mod/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php b/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php new file mode 100644 index 00000000..6f3dc97b --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php @@ -0,0 +1,12 @@ + 'components/{$name}/', + 'module' => 'modules/{$name}/', + 'plugin' => 'plugins/{$name}/', + 'template' => 'templates/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php b/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php new file mode 100644 index 00000000..d5321a8c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php @@ -0,0 +1,29 @@ + 'system/expressionengine/third_party/{$name}/', + 'theme' => 'themes/third_party/{$name}/', + ); + + private $ee3Locations = array( + 'addon' => 'system/user/addons/{$name}/', + 'theme' => 'themes/user/{$name}/', + ); + + public function getInstallPath(PackageInterface $package, $frameworkType = '') + { + + $version = "{$frameworkType}Locations"; + $this->locations = $this->$version; + + return parent::getInstallPath($package, $frameworkType); + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php b/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php new file mode 100644 index 00000000..f30ebcc7 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php @@ -0,0 +1,10 @@ + 'web/assets/ezplatform/', + 'assets' => 'web/assets/ezplatform/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php b/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php new file mode 100644 index 00000000..6eba2e34 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php @@ -0,0 +1,11 @@ + 'fuel/app/modules/{$name}/', + 'package' => 'fuel/packages/{$name}/', + 'theme' => 'fuel/app/themes/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php b/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php new file mode 100644 index 00000000..29d980b3 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php @@ -0,0 +1,9 @@ + 'components/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/GravInstaller.php b/vendor/composer/installers/src/Composer/Installers/GravInstaller.php new file mode 100644 index 00000000..dbe63e07 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/GravInstaller.php @@ -0,0 +1,30 @@ + 'user/plugins/{$name}/', + 'theme' => 'user/themes/{$name}/', + ); + + /** + * Format package name + * + * @param array $vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + $restrictedWords = implode('|', array_keys($this->locations)); + + $vars['name'] = strtolower($vars['name']); + $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui', + '$1', + $vars['name'] + ); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php b/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php new file mode 100644 index 00000000..8fe017f0 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php @@ -0,0 +1,25 @@ + 'plugins/{$name}/', + 'theme' => 'plugins/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $nameParts = explode('/', $vars['name']); + foreach ($nameParts as &$value) { + $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value)); + $value = str_replace(array('-', '_'), ' ', $value); + $value = str_replace(' ', '', ucwords($value)); + } + $vars['name'] = implode('/', $nameParts); + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php b/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php new file mode 100644 index 00000000..5e2142ea --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php @@ -0,0 +1,11 @@ + 'templates/{$name}/', + 'module' => 'application/modules/{$name}/', + 'library' => 'application/libraries/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/Installer.php b/vendor/composer/installers/src/Composer/Installers/Installer.php new file mode 100644 index 00000000..352cb7fa --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/Installer.php @@ -0,0 +1,274 @@ + 'AimeosInstaller', + 'asgard' => 'AsgardInstaller', + 'attogram' => 'AttogramInstaller', + 'agl' => 'AglInstaller', + 'annotatecms' => 'AnnotateCmsInstaller', + 'bitrix' => 'BitrixInstaller', + 'bonefish' => 'BonefishInstaller', + 'cakephp' => 'CakePHPInstaller', + 'chef' => 'ChefInstaller', + 'civicrm' => 'CiviCrmInstaller', + 'ccframework' => 'ClanCatsFrameworkInstaller', + 'cockpit' => 'CockpitInstaller', + 'codeigniter' => 'CodeIgniterInstaller', + 'concrete5' => 'Concrete5Installer', + 'craft' => 'CraftInstaller', + 'croogo' => 'CroogoInstaller', + 'dokuwiki' => 'DokuWikiInstaller', + 'dolibarr' => 'DolibarrInstaller', + 'decibel' => 'DecibelInstaller', + 'drupal' => 'DrupalInstaller', + 'elgg' => 'ElggInstaller', + 'eliasis' => 'EliasisInstaller', + 'ee3' => 'ExpressionEngineInstaller', + 'ee2' => 'ExpressionEngineInstaller', + 'ezplatform' => 'EzPlatformInstaller', + 'fuel' => 'FuelInstaller', + 'fuelphp' => 'FuelphpInstaller', + 'grav' => 'GravInstaller', + 'hurad' => 'HuradInstaller', + 'imagecms' => 'ImageCMSInstaller', + 'itop' => 'ItopInstaller', + 'joomla' => 'JoomlaInstaller', + 'kanboard' => 'KanboardInstaller', + 'kirby' => 'KirbyInstaller', + 'kodicms' => 'KodiCMSInstaller', + 'kohana' => 'KohanaInstaller', + 'lms' => 'LanManagementSystemInstaller', + 'laravel' => 'LaravelInstaller', + 'lavalite' => 'LavaLiteInstaller', + 'lithium' => 'LithiumInstaller', + 'magento' => 'MagentoInstaller', + 'majima' => 'MajimaInstaller', + 'mako' => 'MakoInstaller', + 'maya' => 'MayaInstaller', + 'mautic' => 'MauticInstaller', + 'mediawiki' => 'MediaWikiInstaller', + 'microweber' => 'MicroweberInstaller', + 'modulework' => 'MODULEWorkInstaller', + 'modx' => 'ModxInstaller', + 'modxevo' => 'MODXEvoInstaller', + 'moodle' => 'MoodleInstaller', + 'october' => 'OctoberInstaller', + 'ontowiki' => 'OntoWikiInstaller', + 'oxid' => 'OxidInstaller', + 'osclass' => 'OsclassInstaller', + 'pxcms' => 'PxcmsInstaller', + 'phpbb' => 'PhpBBInstaller', + 'pimcore' => 'PimcoreInstaller', + 'piwik' => 'PiwikInstaller', + 'plentymarkets'=> 'PlentymarketsInstaller', + 'ppi' => 'PPIInstaller', + 'puppet' => 'PuppetInstaller', + 'radphp' => 'RadPHPInstaller', + 'phifty' => 'PhiftyInstaller', + 'porto' => 'PortoInstaller', + 'redaxo' => 'RedaxoInstaller', + 'reindex' => 'ReIndexInstaller', + 'roundcube' => 'RoundcubeInstaller', + 'shopware' => 'ShopwareInstaller', + 'sitedirect' => 'SiteDirectInstaller', + 'silverstripe' => 'SilverStripeInstaller', + 'smf' => 'SMFInstaller', + 'sydes' => 'SyDESInstaller', + 'symfony1' => 'Symfony1Installer', + 'thelia' => 'TheliaInstaller', + 'tusk' => 'TuskInstaller', + 'typo3-cms' => 'TYPO3CmsInstaller', + 'typo3-flow' => 'TYPO3FlowInstaller', + 'userfrosting' => 'UserFrostingInstaller', + 'vanilla' => 'VanillaInstaller', + 'whmcs' => 'WHMCSInstaller', + 'wolfcms' => 'WolfCMSInstaller', + 'wordpress' => 'WordPressInstaller', + 'yawik' => 'YawikInstaller', + 'zend' => 'ZendInstaller', + 'zikula' => 'ZikulaInstaller', + 'prestashop' => 'PrestashopInstaller' + ); + + /** + * Installer constructor. + * + * Disables installers specified in main composer extra installer-disable + * list + * + * @param IOInterface $io + * @param Composer $composer + * @param string $type + * @param Filesystem|null $filesystem + * @param BinaryInstaller|null $binaryInstaller + */ + public function __construct( + IOInterface $io, + Composer $composer, + $type = 'library', + Filesystem $filesystem = null, + BinaryInstaller $binaryInstaller = null + ) { + parent::__construct($io, $composer, $type, $filesystem, + $binaryInstaller); + $this->removeDisabledInstallers(); + } + + /** + * {@inheritDoc} + */ + public function getInstallPath(PackageInterface $package) + { + $type = $package->getType(); + $frameworkType = $this->findFrameworkType($type); + + if ($frameworkType === false) { + throw new \InvalidArgumentException( + 'Sorry the package type of this package is not yet supported.' + ); + } + + $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType]; + $installer = new $class($package, $this->composer, $this->getIO()); + + return $installer->getInstallPath($package, $frameworkType); + } + + public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) + { + parent::uninstall($repo, $package); + $installPath = $this->getPackageBasePath($package); + $this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? 'deleted' : 'not deleted')); + } + + /** + * {@inheritDoc} + */ + public function supports($packageType) + { + $frameworkType = $this->findFrameworkType($packageType); + + if ($frameworkType === false) { + return false; + } + + $locationPattern = $this->getLocationPattern($frameworkType); + + return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1; + } + + /** + * Finds a supported framework type if it exists and returns it + * + * @param string $type + * @return string + */ + protected function findFrameworkType($type) + { + $frameworkType = false; + + krsort($this->supportedTypes); + + foreach ($this->supportedTypes as $key => $val) { + if ($key === substr($type, 0, strlen($key))) { + $frameworkType = substr($type, 0, strlen($key)); + break; + } + } + + return $frameworkType; + } + + /** + * Get the second part of the regular expression to check for support of a + * package type + * + * @param string $frameworkType + * @return string + */ + protected function getLocationPattern($frameworkType) + { + $pattern = false; + if (!empty($this->supportedTypes[$frameworkType])) { + $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType]; + /** @var BaseInstaller $framework */ + $framework = new $frameworkClass(null, $this->composer, $this->getIO()); + $locations = array_keys($framework->getLocations()); + $pattern = $locations ? '(' . implode('|', $locations) . ')' : false; + } + + return $pattern ? : '(\w+)'; + } + + /** + * Get I/O object + * + * @return IOInterface + */ + private function getIO() + { + return $this->io; + } + + /** + * Look for installers set to be disabled in composer's extra config and + * remove them from the list of supported installers. + * + * Globals: + * - true, "all", and "*" - disable all installers. + * - false - enable all installers (useful with + * wikimedia/composer-merge-plugin or similar) + * + * @return void + */ + protected function removeDisabledInstallers() + { + $extra = $this->composer->getPackage()->getExtra(); + + if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) { + // No installers are disabled + return; + } + + // Get installers to disable + $disable = $extra['installer-disable']; + + // Ensure $disabled is an array + if (!is_array($disable)) { + $disable = array($disable); + } + + // Check which installers should be disabled + $all = array(true, "all", "*"); + $intersect = array_intersect($all, $disable); + if (!empty($intersect)) { + // Disable all installers + $this->supportedTypes = array(); + } else { + // Disable specified installers + foreach ($disable as $key => $installer) { + if (is_string($installer) && key_exists($installer, $this->supportedTypes)) { + unset($this->supportedTypes[$installer]); + } + } + } + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php b/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php new file mode 100644 index 00000000..c6c1b337 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php @@ -0,0 +1,9 @@ + 'extensions/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php b/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php new file mode 100644 index 00000000..9ee77596 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php @@ -0,0 +1,15 @@ + 'components/{$name}/', + 'module' => 'modules/{$name}/', + 'template' => 'templates/{$name}/', + 'plugin' => 'plugins/{$name}/', + 'library' => 'libraries/{$name}/', + ); + + // TODO: Add inflector for mod_ and com_ names +} diff --git a/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php b/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php new file mode 100644 index 00000000..9cb7b8cd --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php @@ -0,0 +1,18 @@ + 'plugins/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php b/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php new file mode 100644 index 00000000..36b2f84a --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php @@ -0,0 +1,11 @@ + 'site/plugins/{$name}/', + 'field' => 'site/fields/{$name}/', + 'tag' => 'site/tags/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php b/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php new file mode 100644 index 00000000..7143e232 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php @@ -0,0 +1,10 @@ + 'cms/plugins/{$name}/', + 'media' => 'cms/media/vendor/{$name}/' + ); +} \ No newline at end of file diff --git a/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php b/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php new file mode 100644 index 00000000..dcd6d263 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php @@ -0,0 +1,9 @@ + 'modules/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php b/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php new file mode 100644 index 00000000..903143a5 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php @@ -0,0 +1,27 @@ + 'plugins/{$name}/', + 'template' => 'templates/{$name}/', + 'document-template' => 'documents/templates/{$name}/', + 'userpanel-module' => 'userpanel/modules/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name'])); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } + +} diff --git a/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php b/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php new file mode 100644 index 00000000..be4d53a7 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php @@ -0,0 +1,9 @@ + 'libraries/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php b/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php new file mode 100644 index 00000000..412c0b5c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php @@ -0,0 +1,10 @@ + 'packages/{$vendor}/{$name}/', + 'theme' => 'public/themes/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php b/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php new file mode 100644 index 00000000..47bbd4ca --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php @@ -0,0 +1,10 @@ + 'libraries/{$name}/', + 'source' => 'libraries/_source/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php b/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php new file mode 100644 index 00000000..9c2e9fb4 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php @@ -0,0 +1,9 @@ + 'modules/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php b/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php new file mode 100644 index 00000000..5a664608 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php @@ -0,0 +1,16 @@ + 'assets/snippets/{$name}/', + 'plugin' => 'assets/plugins/{$name}/', + 'module' => 'assets/modules/{$name}/', + 'template' => 'assets/templates/{$name}/', + 'lib' => 'assets/lib/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php b/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php new file mode 100644 index 00000000..cf18e947 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php @@ -0,0 +1,11 @@ + 'app/design/frontend/{$name}/', + 'skin' => 'skin/frontend/default/{$name}/', + 'library' => 'lib/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php b/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php new file mode 100644 index 00000000..e463756f --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php @@ -0,0 +1,37 @@ + 'plugins/{$name}/', + ); + + /** + * Transforms the names + * @param array $vars + * @return array + */ + public function inflectPackageVars($vars) + { + return $this->correctPluginName($vars); + } + + /** + * Change hyphenated names to camelcase + * @param array $vars + * @return array + */ + private function correctPluginName($vars) + { + $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) { + return strtoupper($matches[0][1]); + }, $vars['name']); + $vars['name'] = ucfirst($camelCasedName); + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php b/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php new file mode 100644 index 00000000..ca3cfacb --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php @@ -0,0 +1,9 @@ + 'app/packages/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php b/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php new file mode 100644 index 00000000..3e1ce2b2 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php @@ -0,0 +1,25 @@ + 'plugins/{$name}/', + 'theme' => 'themes/{$name}/', + ); + + /** + * Format package name of mautic-plugins to CamelCase + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] == 'mautic-plugin') { + $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) { + return strtoupper($matches[0][1]); + }, ucfirst($vars['name'])); + } + + return $vars; + } + +} diff --git a/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php b/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php new file mode 100644 index 00000000..30a91676 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php @@ -0,0 +1,33 @@ + 'modules/{$name}/', + ); + + /** + * Format package name. + * + * For package type maya-module, cut off a trailing '-module' if present. + * + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'maya-module') { + return $this->inflectModuleVars($vars); + } + + return $vars; + } + + protected function inflectModuleVars($vars) + { + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php b/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php new file mode 100644 index 00000000..f5a8957e --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php @@ -0,0 +1,51 @@ + 'core/', + 'extension' => 'extensions/{$name}/', + 'skin' => 'skins/{$name}/', + ); + + /** + * Format package name. + * + * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform + * to CamelCase keeping existing uppercase chars. + * + * For package type mediawiki-skin, cut off a trailing '-skin' if present. + * + */ + public function inflectPackageVars($vars) + { + + if ($vars['type'] === 'mediawiki-extension') { + return $this->inflectExtensionVars($vars); + } + + if ($vars['type'] === 'mediawiki-skin') { + return $this->inflectSkinVars($vars); + } + + return $vars; + } + + protected function inflectExtensionVars($vars) + { + $vars['name'] = preg_replace('/-extension$/', '', $vars['name']); + $vars['name'] = str_replace('-', ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } + + protected function inflectSkinVars($vars) + { + $vars['name'] = preg_replace('/-skin$/', '', $vars['name']); + + return $vars; + } + +} diff --git a/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php b/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php new file mode 100644 index 00000000..4bbbec8c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php @@ -0,0 +1,111 @@ + 'userfiles/modules/{$name}/', + 'module-skin' => 'userfiles/modules/{$name}/templates/', + 'template' => 'userfiles/templates/{$name}/', + 'element' => 'userfiles/elements/{$name}/', + 'vendor' => 'vendor/{$name}/', + 'components' => 'components/{$name}/' + ); + + /** + * Format package name. + * + * For package type microweber-module, cut off a trailing '-module' if present + * + * For package type microweber-template, cut off a trailing '-template' if present. + * + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'microweber-template') { + return $this->inflectTemplateVars($vars); + } + if ($vars['type'] === 'microweber-templates') { + return $this->inflectTemplatesVars($vars); + } + if ($vars['type'] === 'microweber-core') { + return $this->inflectCoreVars($vars); + } + if ($vars['type'] === 'microweber-adapter') { + return $this->inflectCoreVars($vars); + } + if ($vars['type'] === 'microweber-module') { + return $this->inflectModuleVars($vars); + } + if ($vars['type'] === 'microweber-modules') { + return $this->inflectModulesVars($vars); + } + if ($vars['type'] === 'microweber-skin') { + return $this->inflectSkinVars($vars); + } + if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') { + return $this->inflectElementVars($vars); + } + + return $vars; + } + + protected function inflectTemplateVars($vars) + { + $vars['name'] = preg_replace('/-template$/', '', $vars['name']); + $vars['name'] = preg_replace('/template-$/', '', $vars['name']); + + return $vars; + } + + protected function inflectTemplatesVars($vars) + { + $vars['name'] = preg_replace('/-templates$/', '', $vars['name']); + $vars['name'] = preg_replace('/templates-$/', '', $vars['name']); + + return $vars; + } + + protected function inflectCoreVars($vars) + { + $vars['name'] = preg_replace('/-providers$/', '', $vars['name']); + $vars['name'] = preg_replace('/-provider$/', '', $vars['name']); + $vars['name'] = preg_replace('/-adapter$/', '', $vars['name']); + + return $vars; + } + + protected function inflectModuleVars($vars) + { + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); + $vars['name'] = preg_replace('/module-$/', '', $vars['name']); + + return $vars; + } + + protected function inflectModulesVars($vars) + { + $vars['name'] = preg_replace('/-modules$/', '', $vars['name']); + $vars['name'] = preg_replace('/modules-$/', '', $vars['name']); + + return $vars; + } + + protected function inflectSkinVars($vars) + { + $vars['name'] = preg_replace('/-skin$/', '', $vars['name']); + $vars['name'] = preg_replace('/skin-$/', '', $vars['name']); + + return $vars; + } + + protected function inflectElementVars($vars) + { + $vars['name'] = preg_replace('/-elements$/', '', $vars['name']); + $vars['name'] = preg_replace('/elements-$/', '', $vars['name']); + $vars['name'] = preg_replace('/-element$/', '', $vars['name']); + $vars['name'] = preg_replace('/element-$/', '', $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php b/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php new file mode 100644 index 00000000..0ee140ab --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php @@ -0,0 +1,12 @@ + 'core/packages/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php b/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php new file mode 100644 index 00000000..a89c82f7 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php @@ -0,0 +1,57 @@ + 'mod/{$name}/', + 'admin_report' => 'admin/report/{$name}/', + 'atto' => 'lib/editor/atto/plugins/{$name}/', + 'tool' => 'admin/tool/{$name}/', + 'assignment' => 'mod/assignment/type/{$name}/', + 'assignsubmission' => 'mod/assign/submission/{$name}/', + 'assignfeedback' => 'mod/assign/feedback/{$name}/', + 'auth' => 'auth/{$name}/', + 'availability' => 'availability/condition/{$name}/', + 'block' => 'blocks/{$name}/', + 'booktool' => 'mod/book/tool/{$name}/', + 'cachestore' => 'cache/stores/{$name}/', + 'cachelock' => 'cache/locks/{$name}/', + 'calendartype' => 'calendar/type/{$name}/', + 'format' => 'course/format/{$name}/', + 'coursereport' => 'course/report/{$name}/', + 'datafield' => 'mod/data/field/{$name}/', + 'datapreset' => 'mod/data/preset/{$name}/', + 'editor' => 'lib/editor/{$name}/', + 'enrol' => 'enrol/{$name}/', + 'filter' => 'filter/{$name}/', + 'gradeexport' => 'grade/export/{$name}/', + 'gradeimport' => 'grade/import/{$name}/', + 'gradereport' => 'grade/report/{$name}/', + 'gradingform' => 'grade/grading/form/{$name}/', + 'local' => 'local/{$name}/', + 'logstore' => 'admin/tool/log/store/{$name}/', + 'ltisource' => 'mod/lti/source/{$name}/', + 'ltiservice' => 'mod/lti/service/{$name}/', + 'message' => 'message/output/{$name}/', + 'mnetservice' => 'mnet/service/{$name}/', + 'plagiarism' => 'plagiarism/{$name}/', + 'portfolio' => 'portfolio/{$name}/', + 'qbehaviour' => 'question/behaviour/{$name}/', + 'qformat' => 'question/format/{$name}/', + 'qtype' => 'question/type/{$name}/', + 'quizaccess' => 'mod/quiz/accessrule/{$name}/', + 'quiz' => 'mod/quiz/report/{$name}/', + 'report' => 'report/{$name}/', + 'repository' => 'repository/{$name}/', + 'scormreport' => 'mod/scorm/report/{$name}/', + 'search' => 'search/engine/{$name}/', + 'theme' => 'theme/{$name}/', + 'tinymce' => 'lib/editor/tinymce/plugins/{$name}/', + 'profilefield' => 'user/profile/field/{$name}/', + 'webservice' => 'webservice/{$name}/', + 'workshopallocation' => 'mod/workshop/allocation/{$name}/', + 'workshopeval' => 'mod/workshop/eval/{$name}/', + 'workshopform' => 'mod/workshop/form/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php b/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php new file mode 100644 index 00000000..08d5dc4e --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php @@ -0,0 +1,47 @@ + 'modules/{$name}/', + 'plugin' => 'plugins/{$vendor}/{$name}/', + 'theme' => 'themes/{$name}/' + ); + + /** + * Format package name. + * + * For package type october-plugin, cut off a trailing '-plugin' if present. + * + * For package type october-theme, cut off a trailing '-theme' if present. + * + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'october-plugin') { + return $this->inflectPluginVars($vars); + } + + if ($vars['type'] === 'october-theme') { + return $this->inflectThemeVars($vars); + } + + return $vars; + } + + protected function inflectPluginVars($vars) + { + $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']); + $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']); + + return $vars; + } + + protected function inflectThemeVars($vars) + { + $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php b/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php new file mode 100644 index 00000000..5dd3438d --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php @@ -0,0 +1,24 @@ + 'extensions/{$name}/', + 'theme' => 'extensions/themes/{$name}/', + 'translation' => 'extensions/translations/{$name}/', + ); + + /** + * Format package name to lower case and remove ".ontowiki" suffix + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower($vars['name']); + $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']); + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); + $vars['name'] = preg_replace('/-translation$/', '', $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php b/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php new file mode 100644 index 00000000..3ca7954c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php @@ -0,0 +1,14 @@ + 'oc-content/plugins/{$name}/', + 'theme' => 'oc-content/themes/{$name}/', + 'language' => 'oc-content/languages/{$name}/', + ); + +} diff --git a/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php b/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php new file mode 100644 index 00000000..49940ff6 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php @@ -0,0 +1,59 @@ +.+)\/.+/'; + + protected $locations = array( + 'module' => 'modules/{$name}/', + 'theme' => 'application/views/{$name}/', + 'out' => 'out/{$name}/', + ); + + /** + * getInstallPath + * + * @param PackageInterface $package + * @param string $frameworkType + * @return void + */ + public function getInstallPath(PackageInterface $package, $frameworkType = '') + { + $installPath = parent::getInstallPath($package, $frameworkType); + $type = $this->package->getType(); + if ($type === 'oxid-module') { + $this->prepareVendorDirectory($installPath); + } + return $installPath; + } + + /** + * prepareVendorDirectory + * + * Makes sure there is a vendormetadata.php file inside + * the vendor folder if there is a vendor folder. + * + * @param string $installPath + * @return void + */ + protected function prepareVendorDirectory($installPath) + { + $matches = ''; + $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches); + if (!$hasVendorDirectory) { + return; + } + + $vendorDirectory = $matches['vendor']; + $vendorPath = getcwd() . '/modules/' . $vendorDirectory; + if (!file_exists($vendorPath)) { + mkdir($vendorPath, 0755, true); + } + + $vendorMetaDataPath = $vendorPath . '/vendormetadata.php'; + touch($vendorMetaDataPath); + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php b/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php new file mode 100644 index 00000000..170136f9 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php @@ -0,0 +1,9 @@ + 'modules/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php b/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php new file mode 100644 index 00000000..4e59a8a7 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php @@ -0,0 +1,11 @@ + 'bundles/{$name}/', + 'library' => 'libraries/{$name}/', + 'framework' => 'frameworks/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php b/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php new file mode 100644 index 00000000..deb2b77a --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php @@ -0,0 +1,11 @@ + 'ext/{$vendor}/{$name}/', + 'language' => 'language/{$name}/', + 'style' => 'styles/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php b/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php new file mode 100644 index 00000000..4781fa6d --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php @@ -0,0 +1,21 @@ + 'plugins/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name'])); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php b/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php new file mode 100644 index 00000000..c17f4572 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php @@ -0,0 +1,32 @@ + 'plugins/{$name}/', + ); + + /** + * Format package name to CamelCase + * @param array $vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name'])); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php b/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php new file mode 100644 index 00000000..903e55f6 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php @@ -0,0 +1,29 @@ + '{$name}/' + ); + + /** + * Remove hyphen, "plugin" and format to camelcase + * @param array $vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + $vars['name'] = explode("-", $vars['name']); + foreach ($vars['name'] as $key => $name) { + $vars['name'][$key] = ucfirst($vars['name'][$key]); + if (strcasecmp($name, "Plugin") == 0) { + unset($vars['name'][$key]); + } + } + $vars['name'] = implode("",$vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/Plugin.php b/vendor/composer/installers/src/Composer/Installers/Plugin.php new file mode 100644 index 00000000..5eb04af1 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/Plugin.php @@ -0,0 +1,17 @@ +getInstallationManager()->addInstaller($installer); + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php b/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php new file mode 100644 index 00000000..dbf85e63 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php @@ -0,0 +1,9 @@ + 'app/Containers/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php b/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php new file mode 100644 index 00000000..4c8421e3 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php @@ -0,0 +1,10 @@ + 'modules/{$name}/', + 'theme' => 'themes/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php b/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php new file mode 100644 index 00000000..77cc3dd8 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php @@ -0,0 +1,11 @@ + 'modules/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php b/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php new file mode 100644 index 00000000..65510580 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php @@ -0,0 +1,63 @@ + 'app/Modules/{$name}/', + 'theme' => 'themes/{$name}/', + ); + + /** + * Format package name. + * + * @param array $vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'pxcms-module') { + return $this->inflectModuleVars($vars); + } + + if ($vars['type'] === 'pxcms-theme') { + return $this->inflectThemeVars($vars); + } + + return $vars; + } + + /** + * For package type pxcms-module, cut off a trailing '-plugin' if present. + * + * return string + */ + protected function inflectModuleVars($vars) + { + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) + $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module- + $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s + $vars['name'] = ucwords($vars['name']); // make module name camelcased + + return $vars; + } + + + /** + * For package type pxcms-module, cut off a trailing '-plugin' if present. + * + * return string + */ + protected function inflectThemeVars($vars) + { + $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy) + $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme- + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme + $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s + $vars['name'] = ucwords($vars['name']); // make module name camelcased + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php b/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php new file mode 100644 index 00000000..0f78b5ca --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php @@ -0,0 +1,24 @@ + 'src/{$name}/' + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $nameParts = explode('/', $vars['name']); + foreach ($nameParts as &$value) { + $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value)); + $value = str_replace(array('-', '_'), ' ', $value); + $value = str_replace(' ', '', ucwords($value)); + } + $vars['name'] = implode('/', $nameParts); + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php b/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php new file mode 100644 index 00000000..252c7339 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php @@ -0,0 +1,10 @@ + 'themes/{$name}/', + 'plugin' => 'plugins/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php b/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php new file mode 100644 index 00000000..09544576 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php @@ -0,0 +1,10 @@ + 'redaxo/include/addons/{$name}/', + 'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/' + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php b/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php new file mode 100644 index 00000000..d8d795be --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php @@ -0,0 +1,22 @@ + 'plugins/{$name}/', + ); + + /** + * Lowercase name and changes the name to a underscores + * + * @param array $vars + * @return array + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower(str_replace('-', '_', $vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php b/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php new file mode 100644 index 00000000..1acd3b14 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php @@ -0,0 +1,10 @@ + 'Sources/{$name}/', + 'theme' => 'Themes/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php b/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php new file mode 100644 index 00000000..7d20d27a --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php @@ -0,0 +1,60 @@ + 'engine/Shopware/Plugins/Local/Backend/{$name}/', + 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/', + 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/', + 'theme' => 'templates/{$name}/', + 'plugin' => 'custom/plugins/{$name}/', + 'frontend-theme' => 'themes/Frontend/{$name}/', + ); + + /** + * Transforms the names + * @param array $vars + * @return array + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'shopware-theme') { + return $this->correctThemeName($vars); + } + + return $this->correctPluginName($vars); + } + + /** + * Changes the name to a camelcased combination of vendor and name + * @param array $vars + * @return array + */ + private function correctPluginName($vars) + { + $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) { + return strtoupper($matches[0][1]); + }, $vars['name']); + + $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName); + + return $vars; + } + + /** + * Changes the name to a underscore separated name + * @param array $vars + * @return array + */ + private function correctThemeName($vars) + { + $vars['name'] = str_replace('-', '_', $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php b/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php new file mode 100644 index 00000000..81910e9f --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php @@ -0,0 +1,35 @@ + '{$name}/', + 'theme' => 'themes/{$name}/', + ); + + /** + * Return the install path based on package type. + * + * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework + * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0 + * + * @param PackageInterface $package + * @param string $frameworkType + * @return string + */ + public function getInstallPath(PackageInterface $package, $frameworkType = '') + { + if ( + $package->getName() == 'silverstripe/framework' + && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion()) + && version_compare($package->getVersion(), '2.999.999') < 0 + ) { + return $this->templatePath($this->locations['module'], array('name' => 'sapphire')); + } + + return parent::getInstallPath($package, $frameworkType); + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php b/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php new file mode 100644 index 00000000..762d94c6 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php @@ -0,0 +1,25 @@ + 'modules/{$vendor}/{$name}/', + 'plugin' => 'plugins/{$vendor}/{$name}/' + ); + + public function inflectPackageVars($vars) + { + return $this->parseVars($vars); + } + + protected function parseVars($vars) + { + $vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor']; + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php b/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php new file mode 100644 index 00000000..83ef9d09 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php @@ -0,0 +1,49 @@ + 'app/modules/{$name}/', + 'theme' => 'themes/{$name}/', + ); + + /** + * Format module name. + * + * Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present. + * + * @param array @vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] == 'sydes-module') { + return $this->inflectModuleVars($vars); + } + + if ($vars['type'] === 'sydes-theme') { + return $this->inflectThemeVars($vars); + } + + return $vars; + } + + public function inflectModuleVars($vars) + { + $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } + + protected function inflectThemeVars($vars) + { + $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']); + $vars['name'] = strtolower($vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php b/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php new file mode 100644 index 00000000..1675c4f2 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php @@ -0,0 +1,26 @@ + + */ +class Symfony1Installer extends BaseInstaller +{ + protected $locations = array( + 'plugin' => 'plugins/{$name}/', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars($vars) + { + $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) { + return strtoupper($matches[0][1]); + }, $vars['name']); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php b/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php new file mode 100644 index 00000000..b1663e84 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php @@ -0,0 +1,16 @@ + + */ +class TYPO3CmsInstaller extends BaseInstaller +{ + protected $locations = array( + 'extension' => 'typo3conf/ext/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php b/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php new file mode 100644 index 00000000..42572f44 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php @@ -0,0 +1,38 @@ + 'Packages/Application/{$name}/', + 'framework' => 'Packages/Framework/{$name}/', + 'plugin' => 'Packages/Plugins/{$name}/', + 'site' => 'Packages/Sites/{$name}/', + 'boilerplate' => 'Packages/Boilerplates/{$name}/', + 'build' => 'Build/{$name}/', + ); + + /** + * Modify the package name to be a TYPO3 Flow style key. + * + * @param array $vars + * @return array + */ + public function inflectPackageVars($vars) + { + $autoload = $this->package->getAutoload(); + if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) { + $namespace = key($autoload['psr-0']); + $vars['name'] = str_replace('\\', '.', $namespace); + } + if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) { + $namespace = key($autoload['psr-4']); + $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.'); + } + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php b/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php new file mode 100644 index 00000000..158af526 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php @@ -0,0 +1,12 @@ + 'local/modules/{$name}/', + 'frontoffice-template' => 'templates/frontOffice/{$name}/', + 'backoffice-template' => 'templates/backOffice/{$name}/', + 'email-template' => 'templates/email/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php b/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php new file mode 100644 index 00000000..7c0113b8 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php @@ -0,0 +1,14 @@ + + */ + class TuskInstaller extends BaseInstaller + { + protected $locations = array( + 'task' => '.tusk/tasks/{$name}/', + 'command' => '.tusk/commands/{$name}/', + 'asset' => 'assets/tusk/{$name}/', + ); + } diff --git a/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php b/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php new file mode 100644 index 00000000..fcb414ab --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php @@ -0,0 +1,9 @@ + 'app/sprinkles/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php b/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php new file mode 100644 index 00000000..24ca6451 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php @@ -0,0 +1,10 @@ + 'plugins/{$name}/', + 'theme' => 'themes/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php b/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php new file mode 100644 index 00000000..7d90c5e6 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php @@ -0,0 +1,49 @@ + 'src/{$vendor}/{$name}/', + 'theme' => 'themes/{$name}/' + ); + + /** + * Format package name. + * + * For package type vgmcp-bundle, cut off a trailing '-bundle' if present. + * + * For package type vgmcp-theme, cut off a trailing '-theme' if present. + * + */ + public function inflectPackageVars($vars) + { + if ($vars['type'] === 'vgmcp-bundle') { + return $this->inflectPluginVars($vars); + } + + if ($vars['type'] === 'vgmcp-theme') { + return $this->inflectThemeVars($vars); + } + + return $vars; + } + + protected function inflectPluginVars($vars) + { + $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } + + protected function inflectThemeVars($vars) + { + $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php b/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php new file mode 100644 index 00000000..2cbb4a46 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php @@ -0,0 +1,10 @@ + 'modules/gateways/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php b/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php new file mode 100644 index 00000000..cb387881 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php @@ -0,0 +1,9 @@ + 'wolf/plugins/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php b/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php new file mode 100644 index 00000000..91c46ad9 --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php @@ -0,0 +1,12 @@ + 'wp-content/plugins/{$name}/', + 'theme' => 'wp-content/themes/{$name}/', + 'muplugin' => 'wp-content/mu-plugins/{$name}/', + 'dropin' => 'wp-content/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php b/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php new file mode 100644 index 00000000..27f429ff --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php @@ -0,0 +1,32 @@ + 'module/{$name}/', + ); + + /** + * Format package name to CamelCase + * @param array $vars + * + * @return array + */ + public function inflectPackageVars($vars) + { + $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name'])); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} \ No newline at end of file diff --git a/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php b/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php new file mode 100644 index 00000000..bde9bc8c --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php @@ -0,0 +1,11 @@ + 'library/{$name}/', + 'extra' => 'extras/library/{$name}/', + 'module' => 'module/{$name}/', + ); +} diff --git a/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php b/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php new file mode 100644 index 00000000..56cdf5da --- /dev/null +++ b/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php @@ -0,0 +1,10 @@ + 'modules/{$vendor}-{$name}/', + 'theme' => 'themes/{$vendor}-{$name}/' + ); +} diff --git a/vendor/composer/installers/src/bootstrap.php b/vendor/composer/installers/src/bootstrap.php new file mode 100644 index 00000000..0de276ee --- /dev/null +++ b/vendor/composer/installers/src/bootstrap.php @@ -0,0 +1,13 @@ += 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `GuzzleHttp\QueryParser` has been replaced with the + `GuzzleHttp\Psr7\parse_query`. + +## 5.2.0 - 2015-01-27 + +* Added `AppliesHeadersInterface` to make applying headers to a request based + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + RingBridge. +* Added a guard in the Pool class to not use recursion for request retries. + +## 5.1.0 - 2014-12-19 + +* Pool class no longer uses recursion when a request is intercepted. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle + specific exceptions if necessary. + +## 5.0.3 - 2014-11-03 + +This change updates query strings so that they are treated as un-encoded values +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +string that should not be parsed or encoded (unless a call to getQuery() is +subsequently made, forcing the query-string to be converted into a Query +object). + +## 5.0.2 - 2014-10-30 + +* Added a trailing `\r\n` to multipart/form-data payloads. See + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* Fixed an issue where transfer statistics were not being populated in the + RingBridge. https://github.com/guzzle/guzzle/issues/866 + +## 5.0.0 - 2014-10-12 + +Adding support for non-blocking responses and some minor API cleanup. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + argument. They now accept an associative array of options, including the + "size" key and "metadata" key which can be used to provide custom metadata. + +## 4.2.2 - 2014-09-08 + +* Fixed a memory leak in the CurlAdapter when reusing cURL handles. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For more information on the 4.0 transition, see: + http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/ +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/Dockerfile b/vendor/guzzlehttp/guzzle/Dockerfile new file mode 100644 index 00000000..efc11656 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/Dockerfile @@ -0,0 +1,18 @@ +FROM composer:latest as setup + +RUN mkdir /guzzle + +WORKDIR /guzzle + +RUN set -xe \ + && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ + && composer require guzzlehttp/guzzle + + +FROM php:7.2 + +RUN mkdir /guzzle + +WORKDIR /guzzle + +COPY --from=setup /guzzle /guzzle diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 00000000..50a177b0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md new file mode 100644 index 00000000..0e826e81 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/README.md @@ -0,0 +1,91 @@ +Guzzle, PHP HTTP client +======================= + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$res = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); +echo $res->getStatusCode(); +// 200 +echo $res->getHeaderLine('content-type'); +// 'application/json; charset=utf8' +echo $res->getBody(); +// '{"id": 1420053, "name": "guzzle", ...}' + +// Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); +$promise->wait(); +``` + +## Help and docs + +- [Documentation](http://guzzlephp.org/) +- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](http://getcomposer.org). + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php +``` + +Next, run the Composer command to install the latest stable version of Guzzle: + +```bash +php composer.phar require guzzlehttp/guzzle +``` + +After installing, you need to require Composer's autoloader: + +```php +require 'vendor/autoload.php'; +``` + +You can then later update Guzzle using composer: + + ```bash +php composer.phar update + ``` + + +## Version Guidance + +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | +| 5.x | Maintained | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | +| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | + +[guzzle-3-repo]: https://github.com/guzzle/guzzle3 +[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x +[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 +[guzzle-6-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: http://guzzle3.readthedocs.org +[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ +[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md new file mode 100644 index 00000000..91d1dcc9 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -0,0 +1,1203 @@ +Guzzle Upgrade Guide +==================== + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: http://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- http://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- http://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json new file mode 100644 index 00000000..bdadb926 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -0,0 +1,58 @@ +{ + "name": "guzzlehttp/guzzle", + "type": "library", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client" + ], + "homepage": "http://guzzlephp.org/", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5", + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Client.php b/vendor/guzzlehttp/guzzle/src/Client.php new file mode 100644 index 00000000..0f43c71f --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Client.php @@ -0,0 +1,422 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. "handler" is a + * constructor only option that cannot be overridden in per/request + * options. If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!is_callable($config['handler'])) { + throw new \InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\uri_for($config['base_uri']); + } + + $this->configureDefaults($config); + } + + public function __call($method, $args) + { + if (count($args) < 1) { + throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = isset($args[1]) ? $args[1] : []; + + return substr($method, -5) === 'Async' + ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + public function sendAsync(RequestInterface $request, array $options = []) + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + public function send(RequestInterface $request, array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); + } + + public function requestAsync($method, $uri = '', array $options = []) + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = isset($options['headers']) ? $options['headers'] : []; + $body = isset($options['body']) ? $options['body'] : null; + $version = isset($options['version']) ? $options['version'] : '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri($uri, $options); + if (is_array($body)) { + $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + public function request($method, $uri = '', array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); + } + + public function getConfig($option = null) + { + return $option === null + ? $this->config + : (isset($this->config[$option]) ? $this->config[$option] : null); + } + + private function buildUri($uri, array $config) + { + // for BC we accept null which would otherwise fail in uri_for + $uri = Psr7\uri_for($uri === null ? '' : $uri); + + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + * + * @param array $config + */ + private function configureDefaults(array $config) + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) { + $defaults['proxy']['http'] = getenv('HTTP_PROXY'); + } + + if ($proxy = getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = getenv('NO_PROXY')) { + $cleanedNoProxy = str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => default_user_agent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (array_keys($this->config['headers']) as $name) { + if (strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = default_user_agent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + * + * @return array + */ + private function prepareDefaults(array $options) + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = null; + unset($options['headers']); + } elseif (!is_array($options['headers'])) { + throw new \InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param RequestInterface $request + * @param array $options + * + * @return Promise\PromiseInterface + */ + private function transfer(RequestInterface $request, array $options) + { + // save_to -> sink + if (isset($options['save_to'])) { + $options['sink'] = $options['save_to']; + unset($options['save_to']); + } + + // exceptions -> http_errors + if (isset($options['exceptions'])) { + $options['http_errors'] = $options['exceptions']; + unset($options['exceptions']); + } + + $request = $this->applyOptions($request, $options); + $handler = $options['handler']; + + try { + return Promise\promise_for($handler($request, $options)); + } catch (\Exception $e) { + return Promise\rejection_for($e); + } + } + + /** + * Applies the array of request options to a request. + * + * @param RequestInterface $request + * @param array $options + * + * @return RequestInterface + */ + private function applyOptions(RequestInterface $request, array &$options) + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new \InvalidArgumentException('You cannot use ' + . 'form_params and multipart at the same time. Use the ' + . 'form_params option if you want to send application/' + . 'x-www-form-urlencoded requests, and the multipart ' + . 'option to send multipart/form-data requests.'); + } + $options['body'] = http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = \GuzzleHttp\json_encode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (is_array($options['body'])) { + $this->invalidBody(); + } + $modify['body'] = Psr7\stream_for($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + . base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (is_array($value)) { + $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); + } + if (!is_string($value)) { + throw new \InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (is_bool($options['sink'])) { + throw new \InvalidArgumentException('sink must not be a boolean'); + } + } + + $request = Psr7\modify_request($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + . $request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\modify_request($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + private function invalidBody() + { + throw new \InvalidArgumentException('Passing in the "body" request ' + . 'option as an array to send a POST request has been deprecated. ' + . 'Please use the "form_params" request option to send a ' + . 'application/x-www-form-urlencoded request, or the "multipart" ' + . 'request option to send a multipart/form-data request.'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 00000000..2dbcffa4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,84 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + * + * @return self + */ + public static function fromArray(array $cookies, $domain) + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true + ])); + } + + return $cookieJar; + } + + /** + * @deprecated + */ + public static function getCookieValue($value) + { + return $value; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + * @return bool + */ + public static function shouldPersist( + SetCookie $cookie, + $allowSessionCookies = false + ) { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName($name) + { + // don't allow a null name + if ($name === null) { + return null; + } + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + } + + public function toArray() + { + return array_map(function (SetCookie $cookie) { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear($domain = null, $path = null, $name = null) + { + if (!$domain) { + $this->cookies = []; + return; + } elseif (!$path) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($domain) { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain) { + return !($cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name && + $cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies() + { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie) + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: ' . $result); + } else { + $this->removeCookieIfEmpty($cookie); + return false; + } + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() || + $c->getDomain() != $cookie->getDomain() || + $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count() + { + return count($this->cookies); + } + + public function getIterator() + { + return new \ArrayIterator(array_values($this->cookies)); + } + + public function extractCookies( + RequestInterface $request, + ResponseInterface $response + ) { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + * + * @param RequestInterface $request + * @return string + */ + private function getCookiePathFromRequest(RequestInterface $request) + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + if (0 === $lastSlashPos = strrpos($uriPath, '/')) { + return '/'; + } + + return substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request) + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) && + $cookie->matchesDomain($host) && + !$cookie->isExpired() && + (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName() . '=' + . $cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + * + * @param SetCookie $cookie + */ + private function removeCookieIfEmpty(SetCookie $cookie) + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 00000000..2cf298a8 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,84 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * @throws \RuntimeException if the file cannot be found or created + */ + public function save($filename) + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = \GuzzleHttp\json_encode($json); + if (false === file_put_contents($filename, $jsonStr)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load($filename) + { + $json = file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } elseif ($json === '') { + return; + } + + $data = \GuzzleHttp\json_decode($json, true); + if (is_array($data)) { + foreach (json_decode($json, true) as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 00000000..4497bcf0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,71 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save() + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load() + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = json_decode($_SESSION[$this->sessionKey], true); + if (is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie data"); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 00000000..3d776a70 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,403 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false + ]; + + /** @var array Cookie data */ + private $data; + + /** + * Create a new SetCookie object from a string + * + * @param string $cookie Set-Cookie header string + * + * @return self + */ + public static function fromString($cookie) + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = array_filter(array_map('trim', explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (empty($pieces[0]) || !strpos($pieces[0], '=')) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = explode('=', $part, 2); + $key = trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (empty($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (array_keys(self::$defaults) as $search) { + if (!strcasecmp($search, $key)) { + $data[$search] = $value; + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + $this->data = array_replace(self::$defaults, $data); + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(time() + $this->getMaxAge()); + } elseif ($this->getExpires() && !is_numeric($this->getExpires())) { + $this->setExpires($this->getExpires()); + } + } + + public function __toString() + { + $str = $this->data['Name'] . '=' . $this->data['Value'] . '; '; + foreach ($this->data as $k => $v) { + if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { + if ($k === 'Expires') { + $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}") . '; '; + } + } + } + + return rtrim($str, '; '); + } + + public function toArray() + { + return $this->data; + } + + /** + * Get the cookie name + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name + * + * @param string $name Cookie name + */ + public function setName($name) + { + $this->data['Name'] = $name; + } + + /** + * Get the cookie value + * + * @return string + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value + * + * @param string $value Cookie value + */ + public function setValue($value) + { + $this->data['Value'] = $value; + } + + /** + * Get the domain + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->data['Domain'] = $domain; + } + + /** + * Get the path + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie + * + * @param string $path Path of the cookie + */ + public function setPath($path) + { + $this->data['Path'] = $path; + } + + /** + * Maximum lifetime of the cookie in seconds + * + * @return int|null + */ + public function getMaxAge() + { + return $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie + * + * @param int $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge) + { + $this->data['Max-Age'] = $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires + * + * @return mixed + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire + * + * @param int $timestamp Unix timestamp + */ + public function setExpires($timestamp) + { + $this->data['Expires'] = is_numeric($timestamp) + ? (int) $timestamp + : strtotime($timestamp); + } + + /** + * Get whether or not this is a secure cookie + * + * @return bool|null + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure) + { + $this->data['Secure'] = $secure; + } + + /** + * Get whether or not this is a session cookie + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard) + { + $this->data['Discard'] = $discard; + } + + /** + * Get whether or not this is an HTTP only cookie + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly) + { + $this->data['HttpOnly'] = $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + * + * @return bool + */ + public function matchesPath($requestPath) + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return substr($requestPath, strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value + * + * @param string $domain Domain to check against + * + * @return bool + */ + public function matchesDomain($domain) + { + // Remove the leading '.' as per spec in RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.2.3 + $cookieDomain = ltrim($this->getDomain(), '.'); + + // Domain not set or exact match. + if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.1.3 + if (filter_var($domain, FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain); + } + + /** + * Check if the cookie is expired + * + * @return bool + */ + public function isExpired() + { + return $this->getExpires() !== null && time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265 + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + // Names must not be empty, but can be 0 + $name = $this->getName(); + if (empty($name) && !is_numeric($name)) { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + . 'Control characters (0-31;127), space, tab and the ' + . 'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be empty, but can be 0 + $value = $this->getValue(); + if (empty($value) && !is_numeric($value)) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0 + // A "0" is not a valid internet domain, but may be used as server name + // in a private network. + $domain = $this->getDomain(); + if (empty($domain) && !is_numeric($domain)) { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 00000000..427d896f --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,27 @@ +getStatusCode() + : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + * + * @param RequestInterface $request + * @param \Exception $e + * + * @return RequestException + */ + public static function wrapException(RequestInterface $request, \Exception $e) + { + return $e instanceof RequestException + ? $e + : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request + * @param ResponseInterface $response Response received + * @param \Exception $previous Previous exception + * @param array $ctx Optional handler context. + * + * @return self + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $previous = null, + array $ctx = [] + ) { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $ctx + ); + } + + $level = (int) floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri, + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = static::getResponseBodySummary($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $ctx); + } + + /** + * Get a short summary of the response + * + * Will return `null` if the response is not printable. + * + * @param ResponseInterface $response + * + * @return string|null + */ + public static function getResponseBodySummary(ResponseInterface $response) + { + $body = $response->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read(120); + $body->rewind(); + + if ($size > 120) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) { + return null; + } + + return $summary; + } + + /** + * Obfuscates URI if there is an username and a password present + * + * @param UriInterface $uri + * + * @return UriInterface + */ + private static function obfuscateUri($uri) + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = strpos($userInfo, ':'))) { + return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + * + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Get the associated response + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Check if a response was received + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + * + * @return array + */ + public function getHandlerContext() + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php new file mode 100644 index 00000000..a77c2892 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php @@ -0,0 +1,27 @@ +stream = $stream; + $msg = $msg ?: 'Could not seek the stream to position ' . $pos; + parent::__construct($msg); + } + + /** + * @return StreamInterface + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 00000000..7cdd3408 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,7 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options) + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle; + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = array_replace($conf, $options['curl']); + } + + $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles + ? array_pop($this->handles) + : curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy) + { + $resource = $easy->handle; + unset($easy->handle); + + if (count($this->handles) >= $this->maxHandles) { + curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); + curl_setopt($resource, CURLOPT_READFUNCTION, null); + curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); + curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); + curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable $handler + * @param EasyHandle $easy + * @param CurlFactoryInterface $factory Dictates how the handle is released + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public static function finish( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy) + { + $curlStats = curl_getinfo($easy->handle); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + call_user_func($easy->options['on_stats'], $stats); + } + + private static function finishError( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => curl_error($easy->handle), + ] + curl_getinfo($easy->handle); + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) + && (!$easy->errno || $easy->errno == 65) + ) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx) + { + static $connectionErrors = [ + CURLE_OPERATION_TIMEOUTED => true, + CURLE_COULDNT_RESOLVE_HOST => true, + CURLE_COULDNT_CONNECT => true, + CURLE_SSL_CONNECT_ERROR => true, + CURLE_GOT_NOTHING => true, + ]; + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return \GuzzleHttp\Promise\rejection_for( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + + $message = sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return \GuzzleHttp\Promise\rejection_for($error); + } + + private function getDefaultConf(EasyHandle $easy) + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + CURLOPT_RETURNTRANSFER => false, + CURLOPT_HEADER => false, + CURLOPT_CONNECTTIMEOUT => 150, + ]; + + if (defined('CURLOPT_PROTOCOLS')) { + $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + } else { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf) + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See http://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[CURLOPT_NOBODY] = true; + unset( + $conf[CURLOPT_WRITEFUNCTION], + $conf[CURLOPT_READFUNCTION], + $conf[CURLOPT_FILE], + $conf[CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf) + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || + !empty($options['_body_as_string']) + ) { + $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf) + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader($name, array &$options) + { + foreach (array_keys($options['_headers']) as $key) { + if (!strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf) + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[CURLOPT_CAINFO]); + $conf[CURLOPT_SSL_VERIFYHOST] = 0; + $conf[CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[CURLOPT_SSL_VERIFYHOST] = 2; + $conf[CURLOPT_SSL_VERIFYPEER] = true; + if (is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!file_exists($options['verify'])) { + throw new \InvalidArgumentException( + "SSL CA bundle not found: {$options['verify']}" + ); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if (is_dir($options['verify']) || + (is_link($options['verify']) && is_dir(readlink($options['verify'])))) { + $conf[CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[CURLOPT_ENCODING] = $accept; + } else { + $conf[CURLOPT_ENCODING] = ''; + // Don't let curl send the header over the wire + $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (isset($options['sink'])) { + $sink = $options['sink']; + if (!is_string($sink)) { + $sink = \GuzzleHttp\Psr7\stream_for($sink); + } elseif (!is_dir(dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(sprintf( + 'Directory %s does not exist for sink value of %s', + dirname($sink), + $sink + )); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { + return $sink->write($write); + }; + } else { + // Use a default temp stream if no sink was set. + $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); + $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); + } + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + $conf[CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!is_array($options['proxy'])) { + $conf[CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (!isset($options['proxy']['no']) || + !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) + ) { + $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (is_array($cert)) { + $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!file_exists($cert)) { + throw new \InvalidArgumentException( + "SSL certificate not found: {$cert}" + ); + } + $conf[CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + $sslKey = $options['ssl_key']; + if (is_array($sslKey)) { + $conf[CURLOPT_SSLKEYPASSWD] = $sslKey[1]; + $sslKey = $sslKey[0]; + } + if (!file_exists($sslKey)) { + throw new \InvalidArgumentException( + "SSL private key not found: {$sslKey}" + ); + } + $conf[CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!is_callable($progress)) { + throw new \InvalidArgumentException( + 'progress client option must be callable' + ); + } + $conf[CURLOPT_NOPROGRESS] = false; + $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { + $args = func_get_args(); + // PHP 5.5 pushed the handle onto the start of the args + if (is_resource($args[0])) { + array_shift($args); + } + call_user_func_array($progress, $args); + }; + } + + if (!empty($options['debug'])) { + $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); + $conf[CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + */ + private static function retryFailedRewind( + callable $handler, + EasyHandle $easy, + array $ctx + ) { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + . 'providing an error. The request would have been retried, ' + . 'but attempting to rewind the request body failed. ' + . 'Exception: ' . $e; + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + . 'and did not succeed. The most likely reason for the failure ' + . 'is that cURL was unable to rewind the body of the request ' + . 'and subsequent retries resulted in the same error. Turn on ' + . 'the debug option to see what went wrong. See ' + . 'https://bugs.php.net/bug.php?id=47204 for more information.'; + return self::createRejection($easy, $ctx); + } else { + $easy->options['_curl_retries']++; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy) + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = trim($h); + if ($value === '') { + $startingResponse = true; + $easy->createResponse(); + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + return strlen($h); + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 00000000..b0fc2368 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,27 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] + : new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options) + { + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + curl_exec($easy->handle); + $easy->errno = curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 00000000..2754d8e4 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,199 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] : new CurlFactory(50); + $this->selectTimeout = isset($options['select_timeout']) + ? $options['select_timeout'] : 1; + } + + public function __get($name) + { + if ($name === '_mh') { + return $this->_mh = curl_multi_init(); + } + + throw new \BadMethodCallException(); + } + + public function __destruct() + { + if (isset($this->_mh)) { + curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick() + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = microtime(true); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\queue()->run(); + + if ($this->active && + curl_multi_select($this->_mh, $this->selectTimeout) === -1 + ) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + usleep(250); + } + + while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute() + { + $queue = P\queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry) + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id) + { + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + curl_multi_remove_handle($this->_mh, $handle); + curl_close($handle); + + return true; + } + + private function processMessages() + { + while ($done = curl_multi_info_read($this->_mh)) { + $id = (int) $done['handle']; + curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish( + $this, + $entry['easy'], + $this->factory + ) + ); + } + } + + private function timeToNext() + { + $currentTime = microtime(true); + $nextTime = PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return max(0, $nextTime - $currentTime) * 1000000; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 00000000..7754e911 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,92 @@ +headers)) { + throw new \RuntimeException('No headers have been received'); + } + + // HTTP-version SP status-code SP reason-phrase + $startLine = explode(' ', array_shift($this->headers), 3); + $headers = \GuzzleHttp\headers_from_lines($this->headers); + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + + if (!empty($this->options['decode_content']) + && isset($normalizedKeys['content-encoding']) + ) { + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $startLine[1], + $headers, + $this->sink, + substr($startLine[0], 5), + isset($startLine[2]) ? (string) $startLine[2] : null + ); + } + + public function __get($name) + { + $msg = $name === 'handle' + ? 'The EasyHandle has been released' + : 'Invalid property: ' . $name; + throw new \BadMethodCallException($msg); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php new file mode 100644 index 00000000..d892061c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -0,0 +1,189 @@ +onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + call_user_func_array([$this, 'append'], $queue); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (is_callable($response)) { + $response = call_user_func($response, $request, $options); + } + + $response = $response instanceof \Exception + ? \GuzzleHttp\Promise\rejection_for($response) + : \GuzzleHttp\Promise\promise_for($response); + + return $response->then( + function ($value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + call_user_func($this->onFulfilled, $value); + } + if (isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (is_resource($sink)) { + fwrite($sink, $contents); + } elseif (is_string($sink)) { + file_put_contents($sink, $contents); + } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + call_user_func($this->onRejected, $reason); + } + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + */ + public function append() + { + foreach (func_get_args() as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Exception + || $value instanceof PromiseInterface + || is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \InvalidArgumentException('Expected a response or ' + . 'exception. Found ' . \GuzzleHttp\describe_type($value)); + } + } + } + + /** + * Get the last received request. + * + * @return RequestInterface + */ + public function getLastRequest() + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + * + * @return array + */ + public function getLastOptions() + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + * + * @return int + */ + public function count() + { + return count($this->queue); + } + + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ) { + if (isset($options['on_stats'])) { + $stats = new TransferStats($request, $response, 0, $reason); + call_user_func($options['on_stats'], $stats); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 00000000..f8b00be0 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,55 @@ +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (strpos($message, 'getaddrinfo') // DNS lookup failed + || strpos($message, 'Connection refused') + || strpos($message, "couldn't connect to host") // error on HHVM + || strpos($message, "connection attempt failed") + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } + $e = RequestException::wrapException($request, $e); + $this->invokeStats($options, $request, $startTime, null, $e); + + return \GuzzleHttp\Promise\rejection_for($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + $startTime, + ResponseInterface $response = null, + $error = null + ) { + if (isset($options['on_stats'])) { + $stats = new TransferStats( + $request, + $response, + microtime(true) - $startTime, + $error, + [] + ); + call_user_func($options['on_stats'], $stats); + } + } + + private function createResponse( + RequestInterface $request, + array $options, + $stream, + $startTime + ) { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + $parts = explode(' ', array_shift($hdrs), 3); + $ver = explode('/', $parts[0])[1]; + $status = $parts[1]; + $reason = isset($parts[2]) ? $parts[2] : null; + $headers = \GuzzleHttp\headers_from_lines($hdrs); + list($stream, $headers) = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\stream_for($stream); + $sink = $stream; + + if (strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $ex = new RequestException($msg, $request, $response, $e); + return \GuzzleHttp\Promise\rejection_for($ex); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain( + $stream, + $sink, + $response->getHeaderLine('Content-Length') + ); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options) + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = isset($options['sink']) + ? $options['sink'] + : fopen('php://temp', 'r+'); + + return is_string($sink) + ? new Psr7\LazyOpenStream($sink, 'w+') + : Psr7\stream_for($sink); + } + + private function checkDecode(array $options, array $headers, $stream) + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream( + Psr7\stream_for($stream) + ); + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param StreamInterface $source + * @param StreamInterface $sink + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @return StreamInterface + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain( + StreamInterface $source, + StreamInterface $sink, + $contentLength + ) { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\copy_to_stream( + $source, + $sink, + (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = null; + set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + $resource = $callback(); + restore_error_handler(); + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . PHP_EOL; + } + } + throw new \RuntimeException(trim($message)); + } + + return $resource; + } + + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = array_flip(get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = array_replace_recursive( + $context, + $options['stream_context'] + ); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth']) + && is_array($options['auth']) + && isset($options['auth'][2]) + && 'ntlm' == $options['auth'][2] + ) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $context = $this->createResource( + function () use ($context, $params) { + return stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $context, $options) { + $resource = fopen((string) $uri, 'r', null, $context); + $this->lastHeaders = $http_response_header; + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options) + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_A); + if (!isset($records[0]['ip'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv4 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost($records[0]['ip']); + } elseif ('v6' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_AAAA); + if (!isset($records[0]['ipv6'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv6 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request) + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = (string) $request->getBody(); + + if (!empty($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = rtrim($context['http']['header']); + + return $context; + } + + private function add_proxy(RequestInterface $request, &$options, $value, &$params) + { + if (!is_array($value)) { + $options['http']['proxy'] = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) + || !\GuzzleHttp\is_host_in_noproxy( + $request->getUri()->getHost(), + $value['no'] + ) + ) { + $options['http']['proxy'] = $value[$scheme]; + } + } + } + } + + private function add_timeout(RequestInterface $request, &$options, $value, &$params) + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + private function add_verify(RequestInterface $request, &$options, $value, &$params) + { + if ($value === true) { + // PHP 5.6 or greater will find the system cert by default. When + // < 5.6, use the Guzzle bundled cacert. + if (PHP_VERSION_ID < 50600) { + $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); + } + } elseif (is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + return; + } else { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + private function add_cert(RequestInterface $request, &$options, $value, &$params) + { + if (is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + private function add_progress(RequestInterface $request, &$options, $value, &$params) + { + $this->addNotification( + $params, + function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == STREAM_NOTIFY_PROGRESS) { + $value($total, $transferred, null, null); + } + } + ); + } + + private function add_debug(RequestInterface $request, &$options, $value, &$params) + { + if ($value === false) { + return; + } + + static $map = [ + STREAM_NOTIFY_CONNECT => 'CONNECT', + STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + STREAM_NOTIFY_PROGRESS => 'PROGRESS', + STREAM_NOTIFY_FAILURE => 'FAILURE', + STREAM_NOTIFY_COMPLETED => 'COMPLETED', + STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', + 'bytes_transferred', 'bytes_max']; + + $value = \GuzzleHttp\debug_resource($value); + $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + $this->addNotification( + $params, + function () use ($ident, $value, $map, $args) { + $passed = func_get_args(); + $code = array_shift($passed); + fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (array_filter($passed) as $i => $v) { + fwrite($value, $args[$i] . ': "' . $v . '" '); + } + fwrite($value, "\n"); + } + ); + } + + private function addNotification(array &$params, callable $notify) + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = $this->callArray([ + $params['notification'], + $notify + ]); + } + } + + private function callArray(array $functions) + { + return function () use ($functions) { + $args = func_get_args(); + foreach ($functions as $fn) { + call_user_func_array($fn, $args); + } + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 00000000..f0016861 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,273 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param callable $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @param RequestInterface $request + * @param array $options + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + if ($this->handler) { + $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + } + + $result = ''; + foreach (array_reverse($this->stack) as $tuple) { + $depth++; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= "Function: " . $this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler) + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + * + * @return bool + */ + public function hasHandler() + { + return (bool) $this->handler; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, $name = null) + { + array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, $name = '') + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove) + { + $this->cached = null; + $idx = is_callable($remove) ? 0 : 1; + $this->stack = array_values(array_filter( + $this->stack, + function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable + */ + public function resolve() + { + if (!$this->cached) { + if (!($prev = $this->handler)) { + throw new \LogicException('No handler has been specified'); + } + + foreach (array_reverse($this->stack) as $fn) { + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + /** + * @param string $name + * @return int + */ + private function findByName($name) + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + * + * @param string $findName + * @param string $withName + * @param callable $middleware + * @param bool $before + */ + private function splice($findName, $withName, callable $middleware, $before) + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param array|callable $fn Function to write as a string. + * + * @return string + */ + private function debugCallable($fn) + { + if (is_string($fn)) { + return "callable({$fn})"; + } + + if (is_array($fn)) { + return is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; + } + + return 'callable(' . spl_object_hash($fn) . ')'; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 00000000..663ac739 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,180 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** @var string Template used to format log messages */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct($template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + * @param \Exception $error Exception that was received + * + * @return string + */ + public function format( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $error = null + ) { + $cache = []; + + return preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\str($request); + break; + case 'response': + $result = $response ? Psr7\str($response) : ''; + break; + case 'req_headers': + $result = trim($request->getMethod() + . ' ' . $request->getRequestTarget()) + . ' HTTP/' . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody(); + break; + case 'res_body': + $result = $response ? $response->getBody() : 'NULL'; + break; + case 'ts': + case 'date_iso_8601': + $result = gmdate('c'); + break; + case 'date_common_log': + $result = date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(substr($matches[1], 11)); + } elseif (strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + private function headers(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . implode(', ', $values) . "\r\n"; + } + + return trim($result); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Middleware.php b/vendor/guzzlehttp/guzzle/src/Middleware.php new file mode 100644 index 00000000..2d762a01 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Middleware.php @@ -0,0 +1,255 @@ +withCookieHeader($request); + return $handler($request, $options) + ->then( + function ($response) use ($cookieJar, $request) { + $cookieJar->extractCookies($request, $response); + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_error" request option is set to true. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function httpErrors() + { + return function (callable $handler) { + return function ($request, array $options) use ($handler) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + return $handler($request, $options)->then( + function (ResponseInterface $response) use ($request) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable Returns a function that accepts the next handler. + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container) + { + if (!is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return function (callable $handler) use (&$container) { + return function ($request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options + ]; + return $value; + }, + function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options + ]; + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null) + { + return function (callable $handler) use ($before, $after) { + return function ($request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect() + { + return function (callable $handler) { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null) + { + return function (callable $handler) use ($decider, $delay) { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO) + { + return function (callable $handler) use ($logger, $formatter, $logLevel) { + return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + function ($response) use ($logger, $request, $formatter, $logLevel) { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + return $response; + }, + function ($reason) use ($logger, $request, $formatter) { + $response = $reason instanceof RequestException + ? $reason->getResponse() + : null; + $message = $formatter->format($request, $response, $reason); + $logger->notice($message); + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + * + * @return callable + */ + public static function prepareBody() + { + return function (callable $handler) { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + * @return callable + */ + public static function mapRequest(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + * @return callable + */ + public static function mapResponse(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 00000000..8f1be33c --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,123 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by ' + . 'the iterator must be a Psr7\Http\Message\RequestInterface ' + . 'or a callable that returns a promise that fulfills ' + . 'with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + public function promise() + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch( + ClientInterface $client, + $requests, + array $options = [] + ) { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + ksort($res); + + return $res; + } + + private static function cmpCallback(array &$options, $name, array &$results) + { + if (!isset($options[$name])) { + $options[$name] = function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 00000000..2eb95f9b --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,106 @@ +nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if ($type = Psr7\mimetype_from_filename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\modify_request($request, $modify), $options); + } + + private function addExpectHeader( + RequestInterface $request, + array $options, + array &$modify + ) { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = isset($options['expect']) ? $options['expect'] : null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 00000000..131b7717 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,237 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** @var callable */ + private $nextHandler; + + /** + * @param callable $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface|PromiseInterface $response + * + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + if (substr($response->getStatusCode(), 0, 1) != '3' + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + if (isset($options['allow_redirects']['on_redirect'])) { + call_user_func( + $options['allow_redirects']['on_redirect'], + $request, + $response, + $nextRequest->getUri() + ); + } + + /** @var PromiseInterface|ResponseInterface $promise */ + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + private function withTracking(PromiseInterface $promise, $uri, $statusCode) + { + return $promise->then( + function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + array_unshift($historyHeader, $uri); + array_unshift($statusHeader, $statusCode); + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + private function guardMax(RequestInterface $request, array &$options) + { + $current = isset($options['__redirect_count']) + ? $options['__redirect_count'] + : 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException( + "Will not follow more than {$max} redirects", + $request + ); + } + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return RequestInterface + */ + public function modifyRequest( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict']) + ) { + $modify['method'] = 'GET'; + $modify['body'] = ''; + } + + $modify['uri'] = $this->redirectUri($request, $response, $protocols); + Psr7\rewind_body($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo('', ''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization header if host is different. + if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + $modify['remove_headers'][] = 'Authorization'; + } + + return Psr7\modify_request($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param array $protocols + * + * @return UriInterface + */ + private function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ) { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!in_array($location->getScheme(), $protocols)) { + throw new BadResponseException( + sprintf( + 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', + $location, + implode(', ', $protocols) + ), + $request, + $response + ); + } + + return $location; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 00000000..c6aacfb1 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,255 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @param int $retries + * + * @return int + */ + public static function exponentialDelay($retries) + { + return (int) pow(2, $retries - 1); + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + private function onFulfilled(RequestInterface $req, array $options) + { + return function ($value) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + $value, + null + )) { + return $value; + } + return $this->doRetry($req, $options, $value); + }; + } + + private function onRejected(RequestInterface $req, array $options) + { + return function ($reason) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + null, + $reason + )) { + return \GuzzleHttp\Promise\rejection_for($reason); + } + return $this->doRetry($req, $options); + }; + } + + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) + { + $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); + + return $this($request, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 00000000..23a22a33 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,126 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + /** + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Returns true if a response was received. + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + * + * @return UriInterface + */ + public function getEffectiveUri() + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float Time in seconds. + */ + public function getTransferTime() + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + * + * @return array + */ + public function getHandlerStats() + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat($stat) + { + return isset($this->handlerStats[$stat]) + ? $this->handlerStats[$stat] + : null; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/vendor/guzzlehttp/guzzle/src/UriTemplate.php new file mode 100644 index 00000000..96dcfd09 --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/UriTemplate.php @@ -0,0 +1,237 @@ + ['prefix' => '', 'joiner' => ',', 'query' => false], + '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], + '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], + '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], + '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], + ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], + '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], + '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] + ]; + + /** @var array Delimiters */ + private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', + '&', '\'', '(', ')', '*', '+', ',', ';', '=']; + + /** @var array Percent encoded delimiters */ + private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', + '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', + '%3B', '%3D']; + + public function expand($template, array $variables) + { + if (false === strpos($template, '{')) { + return $template; + } + + $this->template = $template; + $this->variables = $variables; + + return preg_replace_callback( + '/\{([^\}]+)\}/', + [$this, 'expandMatch'], + $this->template + ); + } + + /** + * Parse an expression into parts + * + * @param string $expression Expression to parse + * + * @return array Returns an associative array of parts + */ + private function parseExpression($expression) + { + $result = []; + + if (isset(self::$operatorHash[$expression[0]])) { + $result['operator'] = $expression[0]; + $expression = substr($expression, 1); + } else { + $result['operator'] = ''; + } + + foreach (explode(',', $expression) as $value) { + $value = trim($value); + $varspec = []; + if ($colonPos = strpos($value, ':')) { + $varspec['value'] = substr($value, 0, $colonPos); + $varspec['modifier'] = ':'; + $varspec['position'] = (int) substr($value, $colonPos + 1); + } elseif (substr($value, -1) === '*') { + $varspec['modifier'] = '*'; + $varspec['value'] = substr($value, 0, -1); + } else { + $varspec['value'] = (string) $value; + $varspec['modifier'] = ''; + } + $result['values'][] = $varspec; + } + + return $result; + } + + /** + * Process an expansion + * + * @param array $matches Matches met in the preg_replace_callback + * + * @return string Returns the replacement string + */ + private function expandMatch(array $matches) + { + static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; + + $replacements = []; + $parsed = self::parseExpression($matches[1]); + $prefix = self::$operatorHash[$parsed['operator']]['prefix']; + $joiner = self::$operatorHash[$parsed['operator']]['joiner']; + $useQuery = self::$operatorHash[$parsed['operator']]['query']; + + foreach ($parsed['values'] as $value) { + if (!isset($this->variables[$value['value']])) { + continue; + } + + $variable = $this->variables[$value['value']]; + $actuallyUseQuery = $useQuery; + $expanded = ''; + + if (is_array($variable)) { + $isAssoc = $this->isAssoc($variable); + $kvp = []; + foreach ($variable as $key => $var) { + if ($isAssoc) { + $key = rawurlencode($key); + $isNestedArray = is_array($var); + } else { + $isNestedArray = false; + } + + if (!$isNestedArray) { + $var = rawurlencode($var); + if ($parsed['operator'] === '+' || + $parsed['operator'] === '#' + ) { + $var = $this->decodeReserved($var); + } + } + + if ($value['modifier'] === '*') { + if ($isAssoc) { + if ($isNestedArray) { + // Nested arrays must allow for deeply nested + // structures. + $var = strtr( + http_build_query([$key => $var]), + $rfc1738to3986 + ); + } else { + $var = $key . '=' . $var; + } + } elseif ($key > 0 && $actuallyUseQuery) { + $var = $value['value'] . '=' . $var; + } + } + + $kvp[$key] = $var; + } + + if (empty($variable)) { + $actuallyUseQuery = false; + } elseif ($value['modifier'] === '*') { + $expanded = implode($joiner, $kvp); + if ($isAssoc) { + // Don't prepend the value name when using the explode + // modifier with an associative array. + $actuallyUseQuery = false; + } + } else { + if ($isAssoc) { + // When an associative array is encountered and the + // explode modifier is not set, then the result must be + // a comma separated list of keys followed by their + // respective values. + foreach ($kvp as $k => &$v) { + $v = $k . ',' . $v; + } + } + $expanded = implode(',', $kvp); + } + } else { + if ($value['modifier'] === ':') { + $variable = substr($variable, 0, $value['position']); + } + $expanded = rawurlencode($variable); + if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { + $expanded = $this->decodeReserved($expanded); + } + } + + if ($actuallyUseQuery) { + if (!$expanded && $joiner !== '&') { + $expanded = $value['value']; + } else { + $expanded = $value['value'] . '=' . $expanded; + } + } + + $replacements[] = $expanded; + } + + $ret = implode($joiner, $replacements); + if ($ret && $prefix) { + return $prefix . $ret; + } + + return $ret; + } + + /** + * Determines if an array is associative. + * + * This makes the assumption that input arrays are sequences or hashes. + * This assumption is a tradeoff for accuracy in favor of speed, but it + * should work in almost every case where input is supplied for a URI + * template. + * + * @param array $array Array to check + * + * @return bool + */ + private function isAssoc(array $array) + { + return $array && array_keys($array)[0] !== 0; + } + + /** + * Removes percent encoding on reserved characters (used with + and # + * modifiers). + * + * @param string $string String to fix + * + * @return string + */ + private function decodeReserved($string) + { + return str_replace(self::$delimsPct, self::$delims, $string); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 00000000..a3ac450d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,333 @@ +expand($template, $variables); +} + +/** + * Debug function used to describe the provided value type and class. + * + * @param mixed $input + * + * @return string Returns a string containing the type of the variable and + * if a class is provided, the class name. + */ +function describe_type($input) +{ + switch (gettype($input)) { + case 'object': + return 'object(' . get_class($input) . ')'; + case 'array': + return 'array(' . count($input) . ')'; + default: + ob_start(); + var_dump($input); + // normalize float vs double + return str_replace('double(', 'float(', rtrim(ob_get_clean())); + } +} + +/** + * Parses an array of header lines into an associative array of headers. + * + * @param array $lines Header lines array of strings in the following + * format: "Name: Value" + * @return array + */ +function headers_from_lines($lines) +{ + $headers = []; + + foreach ($lines as $line) { + $parts = explode(':', $line, 2); + $headers[trim($parts[0])][] = isset($parts[1]) + ? trim($parts[1]) + : null; + } + + return $headers; +} + +/** + * Returns a debug stream based on the provided variable. + * + * @param mixed $value Optional value + * + * @return resource + */ +function debug_resource($value = null) +{ + if (is_resource($value)) { + return $value; + } elseif (defined('STDOUT')) { + return STDOUT; + } + + return fopen('php://output', 'w'); +} + +/** + * Chooses and creates a default handler to use based on the environment. + * + * The returned handler is not wrapped by any default middlewares. + * + * @throws \RuntimeException if no viable Handler is available. + * @return callable Returns the best handler for the given system. + */ +function choose_handler() +{ + $handler = null; + if (function_exists('curl_multi_exec') && function_exists('curl_exec')) { + $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); + } elseif (function_exists('curl_exec')) { + $handler = new CurlHandler(); + } elseif (function_exists('curl_multi_exec')) { + $handler = new CurlMultiHandler(); + } + + if (ini_get('allow_url_fopen')) { + $handler = $handler + ? Proxy::wrapStreaming($handler, new StreamHandler()) + : new StreamHandler(); + } elseif (!$handler) { + throw new \RuntimeException('GuzzleHttp requires cURL, the ' + . 'allow_url_fopen ini setting, or a custom HTTP handler.'); + } + + return $handler; +} + +/** + * Get the default User-Agent string to use with Guzzle + * + * @return string + */ +function default_user_agent() +{ + static $defaultAgent = ''; + + if (!$defaultAgent) { + $defaultAgent = 'GuzzleHttp/' . Client::VERSION; + if (extension_loaded('curl') && function_exists('curl_version')) { + $defaultAgent .= ' curl/' . \curl_version()['version']; + } + $defaultAgent .= ' PHP/' . PHP_VERSION; + } + + return $defaultAgent; +} + +/** + * Returns the default cacert bundle for the current system. + * + * First, the openssl.cafile and curl.cainfo php.ini settings are checked. + * If those settings are not configured, then the common locations for + * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X + * and Windows are checked. If any of these file locations are found on + * disk, they will be utilized. + * + * Note: the result of this function is cached for subsequent calls. + * + * @return string + * @throws \RuntimeException if no bundle can be found. + */ +function default_ca_bundle() +{ + static $cached = null; + static $cafiles = [ + // Red Hat, CentOS, Fedora (provided by the ca-certificates package) + '/etc/pki/tls/certs/ca-bundle.crt', + // Ubuntu, Debian (provided by the ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', + // FreeBSD (provided by the ca_root_nss package) + '/usr/local/share/certs/ca-root-nss.crt', + // SLES 12 (provided by the ca-certificates package) + '/var/lib/ca-certificates/ca-bundle.pem', + // OS X provided by homebrew (using the default path) + '/usr/local/etc/openssl/cert.pem', + // Google app engine + '/etc/ca-certificates.crt', + // Windows? + 'C:\\windows\\system32\\curl-ca-bundle.crt', + 'C:\\windows\\curl-ca-bundle.crt', + ]; + + if ($cached) { + return $cached; + } + + if ($ca = ini_get('openssl.cafile')) { + return $cached = $ca; + } + + if ($ca = ini_get('curl.cainfo')) { + return $cached = $ca; + } + + foreach ($cafiles as $filename) { + if (file_exists($filename)) { + return $cached = $filename; + } + } + + throw new \RuntimeException(<<< EOT +No system CA bundle could be found in any of the the common system locations. +PHP versions earlier than 5.6 are not properly configured to use the system's +CA bundle by default. In order to verify peer certificates, you will need to +supply the path on disk to a certificate bundle to the 'verify' request +option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not +need a specific certificate bundle, then Mozilla provides a commonly used CA +bundle which can be downloaded here (provided by the maintainer of cURL): +https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once +you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP +ini setting to point to the path to the file, allowing you to omit the 'verify' +request option. See http://curl.haxx.se/docs/sslcerts.html for more +information. +EOT + ); +} + +/** + * Creates an associative array of lowercase header names to the actual + * header casing. + * + * @param array $headers + * + * @return array + */ +function normalize_header_keys(array $headers) +{ + $result = []; + foreach (array_keys($headers) as $key) { + $result[strtolower($key)] = $key; + } + + return $result; +} + +/** + * Returns true if the provided host matches any of the no proxy areas. + * + * This method will strip a port from the host if it is present. Each pattern + * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a + * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == + * "baz.foo.com", but ".foo.com" != "foo.com"). + * + * Areas are matched in the following cases: + * 1. "*" (without quotes) always matches any hosts. + * 2. An exact match. + * 3. The area starts with "." and the area is the last part of the host. e.g. + * '.mit.edu' will match any host that ends with '.mit.edu'. + * + * @param string $host Host to check against the patterns. + * @param array $noProxyArray An array of host patterns. + * + * @return bool + */ +function is_host_in_noproxy($host, array $noProxyArray) +{ + if (strlen($host) === 0) { + throw new \InvalidArgumentException('Empty host provided'); + } + + // Strip port if present. + if (strpos($host, ':')) { + $host = explode($host, ':', 2)[0]; + } + + foreach ($noProxyArray as $area) { + // Always match on wildcards. + if ($area === '*') { + return true; + } elseif (empty($area)) { + // Don't match on empty values. + continue; + } elseif ($area === $host) { + // Exact matches. + return true; + } else { + // Special match if the area when prefixed with ".". Remove any + // existing leading "." and add a new leading ".". + $area = '.' . ltrim($area, '.'); + if (substr($host, -(strlen($area))) === $area) { + return true; + } + } + } + + return false; +} + +/** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws \InvalidArgumentException if the JSON cannot be decoded. + * @link http://www.php.net/manual/en/function.json-decode.php + */ +function json_decode($json, $assoc = false, $depth = 512, $options = 0) +{ + $data = \json_decode($json, $assoc, $depth, $options); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException( + 'json_decode error: ' . json_last_error_msg() + ); + } + + return $data; +} + +/** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @return string + * @throws \InvalidArgumentException if the JSON cannot be encoded. + * @link http://www.php.net/manual/en/function.json-encode.php + */ +function json_encode($value, $options = 0, $depth = 512) +{ + $json = \json_encode($value, $options, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException( + 'json_encode error: ' . json_last_error_msg() + ); + } + + return $json; +} diff --git a/vendor/guzzlehttp/guzzle/src/functions_include.php b/vendor/guzzlehttp/guzzle/src/functions_include.php new file mode 100644 index 00000000..a93393ac --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/functions_include.php @@ -0,0 +1,6 @@ + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/promises/Makefile b/vendor/guzzlehttp/promises/Makefile new file mode 100644 index 00000000..8d5b3ef9 --- /dev/null +++ b/vendor/guzzlehttp/promises/Makefile @@ -0,0 +1,13 @@ +all: clean test + +test: + vendor/bin/phpunit + +coverage: + vendor/bin/phpunit --coverage-html=artifacts/coverage + +view-coverage: + open artifacts/coverage/index.html + +clean: + rm -rf artifacts/* diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md new file mode 100644 index 00000000..92d99f2f --- /dev/null +++ b/vendor/guzzlehttp/promises/README.md @@ -0,0 +1,504 @@ +# Guzzle Promises + +[Promises/A+](https://promisesaplus.com/) implementation that handles promise +chaining and resolution iteratively, allowing for "infinite" promise chaining +while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) +for a general introduction to promises. + +- [Features](#features) +- [Quick start](#quick-start) +- [Synchronous wait](#synchronous-wait) +- [Cancellation](#cancellation) +- [API](#api) + - [Promise](#promise) + - [FulfilledPromise](#fulfilledpromise) + - [RejectedPromise](#rejectedpromise) +- [Promise interop](#promise-interop) +- [Implementation notes](#implementation-notes) + + +# Features + +- [Promises/A+](https://promisesaplus.com/) implementation. +- Promise resolution and chaining is handled iteratively, allowing for + "infinite" promise chaining. +- Promises have a synchronous `wait` method. +- Promises can be cancelled. +- Works with any object that has a `then` function. +- C# style async/await coroutine promises using + `GuzzleHttp\Promise\coroutine()`. + + +# Quick start + +A *promise* represents the eventual result of an asynchronous operation. The +primary way of interacting with a promise is through its `then` method, which +registers callbacks to receive either a promise's eventual value or the reason +why the promise cannot be fulfilled. + + +## Callbacks + +Callbacks are registered with the `then` method by providing an optional +`$onFulfilled` followed by an optional `$onRejected` function. + + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then( + // $onFulfilled + function ($value) { + echo 'The promise was fulfilled.'; + }, + // $onRejected + function ($reason) { + echo 'The promise was rejected.'; + } +); +``` + +*Resolving* a promise means that you either fulfill a promise with a *value* or +reject a promise with a *reason*. Resolving a promises triggers callbacks +registered with the promises's `then` method. These callbacks are triggered +only once and in the order in which they were added. + + +## Resolving a promise + +Promises are fulfilled using the `resolve($value)` method. Resolving a promise +with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger +all of the onFulfilled callbacks (resolving a promise with a rejected promise +will reject the promise and trigger the `$onRejected` callbacks). + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(function ($value) { + // Return a value and don't break the chain + return "Hello, " . $value; + }) + // This then is executed after the first then and receives the value + // returned from the first then. + ->then(function ($value) { + echo $value; + }); + +// Resolving the promise triggers the $onFulfilled callbacks and outputs +// "Hello, reader." +$promise->resolve('reader.'); +``` + + +## Promise forwarding + +Promises can be chained one after the other. Each then in the chain is a new +promise. The return value of a promise is what's forwarded to the next +promise in the chain. Returning a promise in a `then` callback will cause the +subsequent promises in the chain to only be fulfilled when the returned promise +has been fulfilled. The next promise in the chain will be invoked with the +resolved value of the promise. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$nextPromise = new Promise(); + +$promise + ->then(function ($value) use ($nextPromise) { + echo $value; + return $nextPromise; + }) + ->then(function ($value) { + echo $value; + }); + +// Triggers the first callback and outputs "A" +$promise->resolve('A'); +// Triggers the second callback and outputs "B" +$nextPromise->resolve('B'); +``` + +## Promise rejection + +When a promise is rejected, the `$onRejected` callbacks are invoked with the +rejection reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + echo $reason; +}); + +$promise->reject('Error!'); +// Outputs "Error!" +``` + +## Rejection forwarding + +If an exception is thrown in an `$onRejected` callback, subsequent +`$onRejected` callbacks are invoked with the thrown exception as the reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + throw new \Exception($reason); +})->then(null, function ($reason) { + assert($reason->getMessage() === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +You can also forward a rejection down the promise chain by returning a +`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or +`$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + return new RejectedPromise($reason); +})->then(null, function ($reason) { + assert($reason === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +If an exception is not thrown in a `$onRejected` callback and the callback +does not return a rejected promise, downstream `$onFulfilled` callbacks are +invoked using the value returned from the `$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise + ->then(null, function ($reason) { + return "It's ok"; + }) + ->then(function ($value) { + assert($value === "It's ok"); + }); + +$promise->reject('Error!'); +``` + +# Synchronous wait + +You can synchronously force promises to complete using a promise's `wait` +method. When creating a promise, you can provide a wait function that is used +to synchronously force a promise to complete. When a wait function is invoked +it is expected to deliver a value to the promise or reject the promise. If the +wait function does not deliver a value, then an exception is thrown. The wait +function provided to a promise constructor is invoked when the `wait` function +of the promise is called. + +```php +$promise = new Promise(function () use (&$promise) { + $promise->resolve('foo'); +}); + +// Calling wait will return the value of the promise. +echo $promise->wait(); // outputs "foo" +``` + +If an exception is encountered while invoking the wait function of a promise, +the promise is rejected with the exception and the exception is thrown. + +```php +$promise = new Promise(function () use (&$promise) { + throw new \Exception('foo'); +}); + +$promise->wait(); // throws the exception. +``` + +Calling `wait` on a promise that has been fulfilled will not trigger the wait +function. It will simply return the previously resolved value. + +```php +$promise = new Promise(function () { die('this is not called!'); }); +$promise->resolve('foo'); +echo $promise->wait(); // outputs "foo" +``` + +Calling `wait` on a promise that has been rejected will throw an exception. If +the rejection reason is an instance of `\Exception` the reason is thrown. +Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason +can be obtained by calling the `getReason` method of the exception. + +```php +$promise = new Promise(); +$promise->reject('foo'); +$promise->wait(); +``` + +> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' + + +## Unwrapping a promise + +When synchronously waiting on a promise, you are joining the state of the +promise into the current state of execution (i.e., return the value of the +promise if it was fulfilled or throw an exception if it was rejected). This is +called "unwrapping" the promise. Waiting on a promise will by default unwrap +the promise state. + +You can force a promise to resolve and *not* unwrap the state of the promise +by passing `false` to the first argument of the `wait` function: + +```php +$promise = new Promise(); +$promise->reject('foo'); +// This will not throw an exception. It simply ensures the promise has +// been resolved. +$promise->wait(false); +``` + +When unwrapping a promise, the resolved value of the promise will be waited +upon until the unwrapped value is not a promise. This means that if you resolve +promise A with a promise B and unwrap promise A, the value returned by the +wait function will be the value delivered to promise B. + +**Note**: when you do not unwrap the promise, no value is returned. + + +# Cancellation + +You can cancel a promise that has not yet been fulfilled using the `cancel()` +method of a promise. When creating a promise you can provide an optional +cancel function that when invoked cancels the action of computing a resolution +of the promise. + + +# API + + +## Promise + +When creating a promise object, you can provide an optional `$waitFn` and +`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is +expected to resolve the promise. `$cancelFn` is a function with no arguments +that is expected to cancel the computation of a promise. It is invoked when the +`cancel()` method of a promise is called. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise( + function () use (&$promise) { + $promise->resolve('waited'); + }, + function () { + // do something that will cancel the promise computation (e.g., close + // a socket, cancel a database query, etc...) + } +); + +assert('waited' === $promise->wait()); +``` + +A promise has the following methods: + +- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` + + Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. + +- `otherwise(callable $onRejected) : PromiseInterface` + + Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. + +- `wait($unwrap = true) : mixed` + + Synchronously waits on the promise to complete. + + `$unwrap` controls whether or not the value of the promise is returned for a + fulfilled promise or if an exception is thrown if the promise is rejected. + This is set to `true` by default. + +- `cancel()` + + Attempts to cancel the promise if possible. The promise being cancelled and + the parent most ancestor that has not yet been resolved will also be + cancelled. Any promises waiting on the cancelled promise to resolve will also + be cancelled. + +- `getState() : string` + + Returns the state of the promise. One of `pending`, `fulfilled`, or + `rejected`. + +- `resolve($value)` + + Fulfills the promise with the given `$value`. + +- `reject($reason)` + + Rejects the promise with the given `$reason`. + + +## FulfilledPromise + +A fulfilled promise can be created to represent a promise that has been +fulfilled. + +```php +use GuzzleHttp\Promise\FulfilledPromise; + +$promise = new FulfilledPromise('value'); + +// Fulfilled callbacks are immediately invoked. +$promise->then(function ($value) { + echo $value; +}); +``` + + +## RejectedPromise + +A rejected promise can be created to represent a promise that has been +rejected. + +```php +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new RejectedPromise('Error'); + +// Rejected callbacks are immediately invoked. +$promise->then(null, function ($reason) { + echo $reason; +}); +``` + + +# Promise interop + +This library works with foreign promises that have a `then` method. This means +you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) +for example. When a foreign promise is returned inside of a then method +callback, promise resolution will occur recursively. + +```php +// Create a React promise +$deferred = new React\Promise\Deferred(); +$reactPromise = $deferred->promise(); + +// Create a Guzzle promise that is fulfilled with a React promise. +$guzzlePromise = new \GuzzleHttp\Promise\Promise(); +$guzzlePromise->then(function ($value) use ($reactPromise) { + // Do something something with the value... + // Return the React promise + return $reactPromise; +}); +``` + +Please note that wait and cancel chaining is no longer possible when forwarding +a foreign promise. You will need to wrap a third-party promise with a Guzzle +promise in order to utilize wait and cancel functions with foreign promises. + + +## Event Loop Integration + +In order to keep the stack size constant, Guzzle promises are resolved +asynchronously using a task queue. When waiting on promises synchronously, the +task queue will be automatically run to ensure that the blocking promise and +any forwarded promises are resolved. When using promises asynchronously in an +event loop, you will need to run the task queue on each tick of the loop. If +you do not run the task queue, then promises will not be resolved. + +You can run the task queue using the `run()` method of the global task queue +instance. + +```php +// Get the global task queue +$queue = \GuzzleHttp\Promise\queue(); +$queue->run(); +``` + +For example, you could use Guzzle promises with React using a periodic timer: + +```php +$loop = React\EventLoop\Factory::create(); +$loop->addPeriodicTimer(0, [$queue, 'run']); +``` + +*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? + + +# Implementation notes + + +## Promise resolution and chaining is handled iteratively + +By shuffling pending handlers from one owner to another, promises are +resolved iteratively, allowing for "infinite" then chaining. + +```php +then(function ($v) { + // The stack size remains constant (a good thing) + echo xdebug_get_stack_depth() . ', '; + return $v + 1; + }); +} + +$parent->resolve(0); +var_dump($p->wait()); // int(1000) + +``` + +When a promise is fulfilled or rejected with a non-promise value, the promise +then takes ownership of the handlers of each child promise and delivers values +down the chain without using recursion. + +When a promise is resolved with another promise, the original promise transfers +all of its pending handlers to the new promise. When the new promise is +eventually resolved, all of the pending handlers are delivered the forwarded +value. + + +## A promise is the deferred. + +Some promise libraries implement promises using a deferred object to represent +a computation and a promise object to represent the delivery of the result of +the computation. This is a nice separation of computation and delivery because +consumers of the promise cannot modify the value that will be eventually +delivered. + +One side effect of being able to implement promise resolution and chaining +iteratively is that you need to be able for one promise to reach into the state +of another promise to shuffle around ownership of handlers. In order to achieve +this without making the handlers of a promise publicly mutable, a promise is +also the deferred value, allowing promises of the same parent class to reach +into and modify the private properties of promises of the same type. While this +does allow consumers of the value to modify the resolution or rejection of the +deferred, it is a small price to pay for keeping the stack size constant. + +```php +$promise = new Promise(); +$promise->then(function ($value) { echo $value; }); +// The promise is the deferred value, so you can deliver a value to it. +$promise->resolve('foo'); +// prints "foo" +``` diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json new file mode 100644 index 00000000..db5e6d1c --- /dev/null +++ b/vendor/guzzlehttp/promises/composer.json @@ -0,0 +1,39 @@ +{ + "name": "guzzlehttp/promises", + "description": "Guzzle promises library", + "keywords": ["promise"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Promise\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "vendor/bin/phpunit", + "test-ci": "vendor/bin/phpunit --coverage-text" + }, + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + } +} diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 00000000..6a5690c3 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,16 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function () { + while (isset($this->currentPromise)) { + $this->currentPromise->wait(); + } + }); + $this->nextCoroutine($this->generator->current()); + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected) + { + return $this->result->otherwise($onRejected); + } + + public function wait($unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState() + { + return $this->result->getState(); + } + + public function resolve($value) + { + $this->result->resolve($value); + } + + public function reject($reason) + { + $this->result->reject($reason); + } + + public function cancel() + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded) + { + $this->currentPromise = promise_for($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value) + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason) + { + unset($this->currentPromise); + try { + $nextYield = $this->generator->throw(exception_for($reason)); + // The throw was caught, so keep iterating on the coroutine + $this->nextCoroutine($nextYield); + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } +} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 00000000..47a21388 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,232 @@ +iterable = iter_for($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + public function promise() + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + $this->iterable->rewind(); + if (!$this->checkIfFinished()) { + $this->refillPending(); + } + } catch (\Throwable $e) { + $this->aggregate->reject($e); + } catch (\Exception $e) { + $this->aggregate->reject($e); + } + + return $this->aggregate; + } + + private function createPromise() + { + $this->mutex = false; + $this->aggregate = new Promise(function () { + reset($this->pending); + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if ($this->aggregate->getState() !== PromiseInterface::PENDING) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function () { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending() + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()); + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? call_user_func($this->concurrency, count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()); + } + + private function addPending() + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = promise_for($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we add the promises at the end + // of the pending array and retrieve the array index being used + $this->pending[] = null; + end($this->pending); + $idx = key($this->pending); + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx, $key) { + if ($this->onFulfilled) { + call_user_func( + $this->onFulfilled, $value, $key, $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx, $key) { + if ($this->onRejected) { + call_user_func( + $this->onRejected, $reason, $key, $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator() + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + try { + $this->iterable->next(); + $this->mutex = false; + return true; + } catch (\Throwable $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } catch (\Exception $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } + } + + private function step($idx) + { + // If the promise was already resolved, then ignore this step. + if ($this->aggregate->getState() !== PromiseInterface::PENDING) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished() + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + return true; + } + + return false; + } +} diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 00000000..dbbeeb9f --- /dev/null +++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,82 @@ +value = $value; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled) { + if ($p->getState() === self::PENDING) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } catch (\Exception $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + return $unwrap ? $this->value : null; + } + + public function getState() + { + return self::FULFILLED; + } + + public function resolve($value) + { + if ($value !== $this->value) { + throw new \LogicException("Cannot resolve a fulfilled promise"); + } + } + + public function reject($reason) + { + throw new \LogicException("Cannot reject a fulfilled promise"); + } + + public function cancel() + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 00000000..8369a954 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,280 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + if ($this->state === self::PENDING) { + $p = new Promise(null, [$this, 'cancel']); + $this->handlers[] = [$p, $onFulfilled, $onRejected]; + $p->waitList = $this->waitList; + $p->waitList[] = $this; + return $p; + } + + // Return a fulfilled promise and immediately invoke any callbacks. + if ($this->state === self::FULFILLED) { + return $onFulfilled + ? promise_for($this->result)->then($onFulfilled) + : promise_for($this->result); + } + + // It's either cancelled or rejected, so return a rejected promise + // and immediately invoke any callbacks. + $rejection = rejection_for($this->result); + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true) + { + $this->waitIfPending(); + + $inner = $this->result instanceof PromiseInterface + ? $this->result->wait($unwrap) + : $this->result; + + if ($unwrap) { + if ($this->result instanceof PromiseInterface + || $this->state === self::FULFILLED + ) { + return $inner; + } else { + // It's rejected so "unwrap" and throw an exception. + throw exception_for($inner); + } + } + } + + public function getState() + { + return $this->state; + } + + public function cancel() + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } catch (\Exception $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value) + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason) + { + $this->settle(self::REJECTED, $reason); + } + + private function settle($state, $value) + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + if (!method_exists($value, 'then')) { + $id = $state === self::FULFILLED ? 1 : 2; + // It's a success, so resolve the handlers in the queue. + queue()->add(static function () use ($id, $value, $handlers) { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise + && $value->getState() === self::PENDING + ) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @param mixed $value Value to pass to the callback. + * @param array $handler Array of handler data (promise and callbacks). + * + * @return array Returns the next group to resolve. + */ + private static function callHandler($index, $value, array $handler) + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if ($promise->getState() !== self::PENDING) { + return; + } + + try { + if (isset($handler[$index])) { + $promise->resolve($handler[$index]($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } catch (\Exception $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending() + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } else { + // If there's no wait function, then reject the promise. + $this->reject('Cannot wait on a promise that has ' + . 'no internal wait function. You must provide a wait ' + . 'function when constructing the promise to be able to ' + . 'wait on a promise.'); + } + + queue()->run(); + + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn() + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Exception $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList() + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + while (true) { + $result->waitIfPending(); + + if ($result->result instanceof Promise) { + $result = $result->result; + } else { + if ($result->result instanceof PromiseInterface) { + $result->result->wait(false); + } + break; + } + } + } + } +} diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 00000000..8f5f4b99 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,93 @@ +reason = $reason; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected) { + if ($p->getState() === self::PENDING) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } catch (\Throwable $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } catch (\Exception $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + if ($unwrap) { + throw exception_for($this->reason); + } + } + + public function getState() + { + return self::REJECTED; + } + + public function resolve($value) + { + throw new \LogicException("Cannot resolve a rejected promise"); + } + + public function reject($reason) + { + if ($reason !== $this->reason) { + throw new \LogicException("Cannot reject a rejected promise"); + } + } + + public function cancel() + { + // pass + } +} diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 00000000..07c1136d --- /dev/null +++ b/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,47 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: ' . $description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: ' . $this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: ' + . json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 00000000..6e8a2a08 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,66 @@ +run(); + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct($withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function () { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty() + { + return !$this->queue; + } + + public function add(callable $task) + { + $this->queue[] = $task; + } + + public function run() + { + /** @var callable $task */ + while ($task = array_shift($this->queue)) { + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown() + { + $this->enableShutdown = false; + } +} diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 00000000..ac8306e1 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,25 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + */ +function queue(TaskQueueInterface $assign = null) +{ + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; +} + +/** + * Adds a function to run in the task queue when it is next `run()` and returns + * a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + */ +function task(callable $task) +{ + $queue = queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise) { + try { + $promise->resolve($task()); + } catch (\Throwable $e) { + $promise->reject($e); + } catch (\Exception $e) { + $promise->reject($e); + } + }); + + return $promise; +} + +/** + * Creates a promise for a value if the value is not a promise. + * + * @param mixed $value Promise or value. + * + * @return PromiseInterface + */ +function promise_for($value) +{ + if ($value instanceof PromiseInterface) { + return $value; + } + + // Return a Guzzle promise that shadows the given promise. + if (method_exists($value, 'then')) { + $wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null; + $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null; + $promise = new Promise($wfn, $cfn); + $value->then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; + } + + return new FulfilledPromise($value); +} + +/** + * Creates a rejected promise for a reason if the reason is not a promise. If + * the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + */ +function rejection_for($reason) +{ + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); +} + +/** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + */ +function exception_for($reason) +{ + return $reason instanceof \Exception || $reason instanceof \Throwable + ? $reason + : new RejectionException($reason); +} + +/** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + */ +function iter_for($value) +{ + if ($value instanceof \Iterator) { + return $value; + } elseif (is_array($value)) { + return new \ArrayIterator($value); + } else { + return new \ArrayIterator([$value]); + } +} + +/** + * Synchronously waits on a promise to resolve and returns an inspection state + * array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the array + * will contain a "value" key mapping to the fulfilled value of the promise. If + * the promise is rejected, the array will contain a "reason" key mapping to + * the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + */ +function inspect(PromiseInterface $promise) +{ + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait() + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } catch (\Exception $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } +} + +/** + * Waits on all of the provided promises, but does not unwrap rejected promises + * as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + * @see GuzzleHttp\Promise\inspect for the inspection state array format. + */ +function inspect_all($promises) +{ + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = inspect($promise); + } + + return $results; +} + +/** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same order + * the promises were provided). An exception is thrown if any of the promises + * are rejected. + * + * @param mixed $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + */ +function unwrap($promises) +{ + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; +} + +/** + * Given an array of promises, return a promise that is fulfilled when all the + * items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive - If true, resolves new promises that might have been added to the stack during its own resolution. + * + * @return PromiseInterface + */ +function all($promises, $recursive = false) +{ + $results = []; + $promise = each( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate) { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises AS $promise) { + if (\GuzzleHttp\Promise\PromiseInterface::PENDING === $promise->getState()) { + return all($promises, $recursive); + } + } + return $results; + }); + } + + return $promise; +} + +/** + * Initiate a competitive race between multiple promises or values (values will + * become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise is + * fulfilled with an array that contains the fulfillment values of the winners + * in order of resolution. + * + * This promise is rejected with a {@see GuzzleHttp\Promise\AggregateException} + * if the number of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ +function some($count, $promises) +{ + $results = []; + $rejections = []; + + return each( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + if ($p->getState() !== PromiseInterface::PENDING) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections) { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + return array_values($results); + } + ); +} + +/** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ +function any($promises) +{ + return some(1, $promises)->then(function ($values) { return $values[0]; }); +} + +/** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * @see GuzzleHttp\Promise\inspect for the inspection state array format. + */ +function settle($promises) +{ + $results = []; + + return each( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); +} + +/** + * Given an iterator that yields promises or values, returns a promise that is + * fulfilled with a null value when the iterator has been consumed or the + * aggregate promise has been fulfilled or rejected. + * + * $onFulfilled is a function that accepts the fulfilled value, iterator + * index, and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate promise if needed. + * + * $onRejected is a function that accepts the rejection reason, iterator + * index, and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate promise if needed. + * + * @param mixed $iterable Iterator or array to iterate over. + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ +function each( + $iterable, + callable $onFulfilled = null, + callable $onRejected = null +) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected + ]))->promise(); +} + +/** + * Like each, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow for + * dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ +function each_limit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null +) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency + ]))->promise(); +} + +/** + * Like each_limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + */ +function each_limit_all( + $iterable, + $concurrency, + callable $onFulfilled = null +) { + return each_limit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate) { + $aggregate->reject($reason); + } + ); +} + +/** + * Returns true if a promise is fulfilled. + * + * @param PromiseInterface $promise + * + * @return bool + */ +function is_fulfilled(PromiseInterface $promise) +{ + return $promise->getState() === PromiseInterface::FULFILLED; +} + +/** + * Returns true if a promise is rejected. + * + * @param PromiseInterface $promise + * + * @return bool + */ +function is_rejected(PromiseInterface $promise) +{ + return $promise->getState() === PromiseInterface::REJECTED; +} + +/** + * Returns true if a promise is fulfilled or rejected. + * + * @param PromiseInterface $promise + * + * @return bool + */ +function is_settled(PromiseInterface $promise) +{ + return $promise->getState() !== PromiseInterface::PENDING; +} + +/** + * @see Coroutine + * + * @param callable $generatorFn + * + * @return PromiseInterface + */ +function coroutine(callable $generatorFn) +{ + return new Coroutine($generatorFn); +} diff --git a/vendor/guzzlehttp/promises/src/functions_include.php b/vendor/guzzlehttp/promises/src/functions_include.php new file mode 100644 index 00000000..34cd1710 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/functions_include.php @@ -0,0 +1,6 @@ +withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[Unreleased]: https://github.com/guzzle/psr7/compare/1.5.2...HEAD +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE new file mode 100644 index 00000000..581d95f9 --- /dev/null +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md new file mode 100644 index 00000000..c60a6a38 --- /dev/null +++ b/vendor/guzzlehttp/psr7/README.md @@ -0,0 +1,745 @@ +# PSR-7 Message Implementation + +This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) +message implementation, several stream decorators, and some helpful +functionality like query string parsing. + + +[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7) + + +# Stream implementation + +This package comes with a number of stream implementations and stream +decorators. + + +## AppendStream + +`GuzzleHttp\Psr7\AppendStream` + +Reads from multiple streams, one after the other. + +```php +use GuzzleHttp\Psr7; + +$a = Psr7\stream_for('abc, '); +$b = Psr7\stream_for('123.'); +$composed = new Psr7\AppendStream([$a, $b]); + +$composed->addStream(Psr7\stream_for(' Above all listen to me')); + +echo $composed; // abc, 123. Above all listen to me. +``` + + +## BufferStream + +`GuzzleHttp\Psr7\BufferStream` + +Provides a buffer stream that can be written to fill a buffer, and read +from to remove bytes from the buffer. + +This stream returns a "hwm" metadata value that tells upstream consumers +what the configured high water mark of the stream is, or the maximum +preferred size of the buffer. + +```php +use GuzzleHttp\Psr7; + +// When more than 1024 bytes are in the buffer, it will begin returning +// false to writes. This is an indication that writers should slow down. +$buffer = new Psr7\BufferStream(1024); +``` + + +## CachingStream + +The CachingStream is used to allow seeking over previously read bytes on +non-seekable streams. This can be useful when transferring a non-seekable +entity body fails due to needing to rewind the stream (for example, resulting +from a redirect). Data that is read from the remote stream will be buffered in +a PHP temp stream so that previously read bytes are cached first in memory, +then on disk. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\stream_for(fopen('http://www.google.com', 'r')); +$stream = new Psr7\CachingStream($original); + +$stream->read(1024); +echo $stream->tell(); +// 1024 + +$stream->seek(0); +echo $stream->tell(); +// 0 +``` + + +## DroppingStream + +`GuzzleHttp\Psr7\DroppingStream` + +Stream decorator that begins dropping data once the size of the underlying +stream becomes too full. + +```php +use GuzzleHttp\Psr7; + +// Create an empty stream +$stream = Psr7\stream_for(); + +// Start dropping data when the stream has more than 10 bytes +$dropping = new Psr7\DroppingStream($stream, 10); + +$dropping->write('01234567890123456789'); +echo $stream; // 0123456789 +``` + + +## FnStream + +`GuzzleHttp\Psr7\FnStream` + +Compose stream implementations based on a hash of functions. + +Allows for easy testing and extension of a provided stream without needing +to create a concrete class for a simple extension point. + +```php + +use GuzzleHttp\Psr7; + +$stream = Psr7\stream_for('hi'); +$fnStream = Psr7\FnStream::decorate($stream, [ + 'rewind' => function () use ($stream) { + echo 'About to rewind - '; + $stream->rewind(); + echo 'rewound!'; + } +]); + +$fnStream->rewind(); +// Outputs: About to rewind - rewound! +``` + + +## InflateStream + +`GuzzleHttp\Psr7\InflateStream` + +Uses PHP's zlib.inflate filter to inflate deflate or gzipped content. + +This stream decorator skips the first 10 bytes of the given stream to remove +the gzip header, converts the provided stream to a PHP stream resource, +then appends the zlib.inflate filter. The stream is then converted back +to a Guzzle stream resource to be used as a Guzzle stream. + + +## LazyOpenStream + +`GuzzleHttp\Psr7\LazyOpenStream` + +Lazily reads or writes to a file that is opened only after an IO operation +take place on the stream. + +```php +use GuzzleHttp\Psr7; + +$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); +// The file has not yet been opened... + +echo $stream->read(10); +// The file is opened and read from only when needed. +``` + + +## LimitStream + +`GuzzleHttp\Psr7\LimitStream` + +LimitStream can be used to read a subset or slice of an existing stream object. +This can be useful for breaking a large file into smaller pieces to be sent in +chunks (e.g. Amazon S3's multipart upload API). + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+')); +echo $original->getSize(); +// >>> 1048576 + +// Limit the size of the body to 1024 bytes and start reading from byte 2048 +$stream = new Psr7\LimitStream($original, 1024, 2048); +echo $stream->getSize(); +// >>> 1024 +echo $stream->tell(); +// >>> 0 +``` + + +## MultipartStream + +`GuzzleHttp\Psr7\MultipartStream` + +Stream that when read returns bytes for a streaming multipart or +multipart/form-data stream. + + +## NoSeekStream + +`GuzzleHttp\Psr7\NoSeekStream` + +NoSeekStream wraps a stream and does not allow seeking. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\stream_for('foo'); +$noSeek = new Psr7\NoSeekStream($original); + +echo $noSeek->read(3); +// foo +var_export($noSeek->isSeekable()); +// false +$noSeek->seek(0); +var_export($noSeek->read(3)); +// NULL +``` + + +## PumpStream + +`GuzzleHttp\Psr7\PumpStream` + +Provides a read only stream that pumps data from a PHP callable. + +When invoking the provided callable, the PumpStream will pass the amount of +data requested to read to the callable. The callable can choose to ignore +this value and return fewer or more bytes than requested. Any extra data +returned by the provided callable is buffered internally until drained using +the read() function of the PumpStream. The provided callable MUST return +false when there is no more data to read. + + +## Implementing stream decorators + +Creating a stream decorator is very easy thanks to the +`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that +implement `Psr\Http\Message\StreamInterface` by proxying to an underlying +stream. Just `use` the `StreamDecoratorTrait` and implement your custom +methods. + +For example, let's say we wanted to call a specific function each time the last +byte is read from a stream. This could be implemented by overriding the +`read()` method. + +```php +use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Psr7\StreamDecoratorTrait; + +class EofCallbackStream implements StreamInterface +{ + use StreamDecoratorTrait; + + private $callback; + + public function __construct(StreamInterface $stream, callable $cb) + { + $this->stream = $stream; + $this->callback = $cb; + } + + public function read($length) + { + $result = $this->stream->read($length); + + // Invoke the callback when EOF is hit. + if ($this->eof()) { + call_user_func($this->callback); + } + + return $result; + } +} +``` + +This decorator could be added to any existing stream and used like so: + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\stream_for('foo'); + +$eofStream = new EofCallbackStream($original, function () { + echo 'EOF!'; +}); + +$eofStream->read(2); +$eofStream->read(1); +// echoes "EOF!" +$eofStream->seek(0); +$eofStream->read(3); +// echoes "EOF!" +``` + + +## PHP StreamWrapper + +You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a +PSR-7 stream as a PHP stream resource. + +Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP +stream from a PSR-7 stream. + +```php +use GuzzleHttp\Psr7\StreamWrapper; + +$stream = GuzzleHttp\Psr7\stream_for('hello!'); +$resource = StreamWrapper::getResource($stream); +echo fread($resource, 6); // outputs hello! +``` + + +# Function API + +There are various functions available under the `GuzzleHttp\Psr7` namespace. + + +## `function str` + +`function str(MessageInterface $message)` + +Returns the string representation of an HTTP message. + +```php +$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); +echo GuzzleHttp\Psr7\str($request); +``` + + +## `function uri_for` + +`function uri_for($uri)` + +This function accepts a string or `Psr\Http\Message\UriInterface` and returns a +UriInterface for the given value. If the value is already a `UriInterface`, it +is returned as-is. + +```php +$uri = GuzzleHttp\Psr7\uri_for('http://example.com'); +assert($uri === GuzzleHttp\Psr7\uri_for($uri)); +``` + + +## `function stream_for` + +`function stream_for($resource = '', array $options = [])` + +Create a new stream based on the input type. + +Options is an associative array that can contain the following keys: + +* - metadata: Array of custom metadata. +* - size: Size of the stream. + +This method accepts the following `$resource` types: + +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. + +```php +$stream = GuzzleHttp\Psr7\stream_for('foo'); +$stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r')); + +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} + +$stream = GuzzleHttp\Psr7\stream_for($generator(100)); +``` + + +## `function parse_header` + +`function parse_header($header)` + +Parse an array of header values containing ";" separated data into an array of +associative arrays representing the header key value pair data of the header. +When a parameter does not contain a value, but just contains a key, this +function will inject a key with a '' string value. + + +## `function normalize_header` + +`function normalize_header($header)` + +Converts an array of header values that may contain comma separated headers +into an array of headers with no comma separated values. + + +## `function modify_request` + +`function modify_request(RequestInterface $request, array $changes)` + +Clone and modify a request with the given changes. This method is useful for +reducing the number of clones needed to mutate a message. + +The changes can be one of: + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. + + +## `function rewind_body` + +`function rewind_body(MessageInterface $message)` + +Attempts to rewind a message body and throws an exception on failure. The body +of the message will only be rewound if a call to `tell()` returns a value other +than `0`. + + +## `function try_fopen` + +`function try_fopen($filename, $mode)` + +Safely opens a PHP stream resource using a filename. + +When fopen fails, PHP normally raises a warning. This function adds an error +handler that checks for errors and throws an exception instead. + + +## `function copy_to_string` + +`function copy_to_string(StreamInterface $stream, $maxLen = -1)` + +Copy the contents of a stream into a string until the given number of bytes +have been read. + + +## `function copy_to_stream` + +`function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)` + +Copy the contents of a stream into another stream until the given number of +bytes have been read. + + +## `function hash` + +`function hash(StreamInterface $stream, $algo, $rawOutput = false)` + +Calculate a hash of a Stream. This method reads the entire stream to calculate +a rolling hash (based on PHP's hash_init functions). + + +## `function readline` + +`function readline(StreamInterface $stream, $maxLength = null)` + +Read a line from the stream up to the maximum allowed buffer length. + + +## `function parse_request` + +`function parse_request($message)` + +Parses a request message string into a request object. + + +## `function parse_response` + +`function parse_response($message)` + +Parses a response message string into a response object. + + +## `function parse_query` + +`function parse_query($str, $urlEncoding = true)` + +Parse a query string into an associative array. + +If multiple values are found for the same key, the value of that key value pair +will become an array. This function does not parse nested PHP style arrays into +an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed into +`['foo[a]' => '1', 'foo[b]' => '2']`). + + +## `function build_query` + +`function build_query(array $params, $encoding = PHP_QUERY_RFC3986)` + +Build a query string from an array of key value pairs. + +This function can use the return value of parse_query() to build a query string. +This function does not modify the provided keys when an array is encountered +(like http_build_query would). + + +## `function mimetype_from_filename` + +`function mimetype_from_filename($filename)` + +Determines the mimetype of a file by looking at its extension. + + +## `function mimetype_from_extension` + +`function mimetype_from_extension($extension)` + +Maps a file extensions to a mimetype. + + +# Additional URI Methods + +Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, +this library also provides additional functionality when working with URIs as static methods. + +## URI Types + +An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. +An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, +the base URI. Relative references can be divided into several forms according to +[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): + +- network-path references, e.g. `//example.com/path` +- absolute-path references, e.g. `/path` +- relative-path references, e.g. `subpath` + +The following methods can be used to identify the type of the URI. + +### `GuzzleHttp\Psr7\Uri::isAbsolute` + +`public static function isAbsolute(UriInterface $uri): bool` + +Whether the URI is absolute, i.e. it has a scheme. + +### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` + +`public static function isNetworkPathReference(UriInterface $uri): bool` + +Whether the URI is a network-path reference. A relative reference that begins with two slash characters is +termed an network-path reference. + +### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` + +`public static function isAbsolutePathReference(UriInterface $uri): bool` + +Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is +termed an absolute-path reference. + +### `GuzzleHttp\Psr7\Uri::isRelativePathReference` + +`public static function isRelativePathReference(UriInterface $uri): bool` + +Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is +termed a relative-path reference. + +### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` + +`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` + +Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its +fragment component, identical to the base URI. When no base URI is given, only an empty URI reference +(apart from its fragment) is considered a same-document reference. + +## URI Components + +Additional methods to work with URI components. + +### `GuzzleHttp\Psr7\Uri::isDefaultPort` + +`public static function isDefaultPort(UriInterface $uri): bool` + +Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null +or the standard port. This method can be used independently of the implementation. + +### `GuzzleHttp\Psr7\Uri::composeComponents` + +`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` + +Composes a URI reference string from its various components according to +[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called +manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. + +### `GuzzleHttp\Psr7\Uri::fromParts` + +`public static function fromParts(array $parts): UriInterface` + +Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components. + + +### `GuzzleHttp\Psr7\Uri::withQueryValue` + +`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` + +Creates a new URI with a specific query string value. Any existing query string values that exactly match the +provided key are removed and replaced with the given key value pair. A value of null will set the query string +key without a value, e.g. "key" instead of "key=value". + +### `GuzzleHttp\Psr7\Uri::withQueryValues` + +`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` + +Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an +associative array of key => value. + +### `GuzzleHttp\Psr7\Uri::withoutQueryValue` + +`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` + +Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the +provided key are removed. + +## Reference Resolution + +`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according +to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers +do when resolving a link in a website based on the current request URI. + +### `GuzzleHttp\Psr7\UriResolver::resolve` + +`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` + +Converts the relative URI into a new URI that is resolved against the base URI. + +### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` + +`public static function removeDotSegments(string $path): string` + +Removes dot segments from a path and returns the new path according to +[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). + +### `GuzzleHttp\Psr7\UriResolver::relativize` + +`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` + +Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): + +```php +(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) +``` + +One use-case is to use the current request URI as base URI and then generate relative links in your documents +to reduce the document size or offer self-contained downloadable document archives. + +```php +$base = new Uri('http://example.com/a/b/'); +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. +echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. +``` + +## Normalization and Comparison + +`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to +[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). + +### `GuzzleHttp\Psr7\UriNormalizer::normalize` + +`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` + +Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. +This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask +of normalizations to apply. The following normalizations are available: + +- `UriNormalizer::PRESERVING_NORMALIZATIONS` + + Default normalizations which only include the ones that preserve semantics. + +- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` + + All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. + + Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` + +- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` + + Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of + ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should + not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved + characters by URI normalizers. + + Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` + +- `UriNormalizer::CONVERT_EMPTY_PATH` + + Converts the empty path to "/" for http and https URIs. + + Example: `http://example.org` → `http://example.org/` + +- `UriNormalizer::REMOVE_DEFAULT_HOST` + + Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host + "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to + RFC 3986. + + Example: `file://localhost/myfile` → `file:///myfile` + +- `UriNormalizer::REMOVE_DEFAULT_PORT` + + Removes the default port of the given URI scheme from the URI. + + Example: `http://example.org:80/` → `http://example.org/` + +- `UriNormalizer::REMOVE_DOT_SEGMENTS` + + Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would + change the semantics of the URI reference. + + Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` + +- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` + + Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes + and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization + may change the semantics. Encoded slashes (%2F) are not removed. + + Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` + +- `UriNormalizer::SORT_QUERY_PARAMETERS` + + Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be + significant (this is not defined by the standard). So this normalization is not safe and may change the semantics + of the URI. + + Example: `?lang=en&article=fred` → `?article=fred&lang=en` + +### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` + +`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` + +Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given +`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. +This of course assumes they will be resolved against the same base URI. If this is not the case, determination of +equivalence or difference of relative references does not mean anything. diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json new file mode 100644 index 00000000..1be0dc3a --- /dev/null +++ b/vendor/guzzlehttp/psr7/composer.json @@ -0,0 +1,48 @@ +{ + "name": "guzzlehttp/psr7", + "type": "library", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Psr7\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 00000000..472a0d61 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,241 @@ +addStream($stream); + } + } + + public function __toString() + { + try { + $this->rewind(); + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream) + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents() + { + return copy_to_string($this); + } + + /** + * Closes each attached stream. + * + * {@inheritdoc} + */ + public function close() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + * + * {@inheritdoc} + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + } + + public function tell() + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + * + * {@inheritdoc} + */ + public function getSize() + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof() + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + public function rewind() + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + * + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + . $i . ' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + * + * {@inheritdoc} + */ + public function read($length) + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + $this->current++; + } + + $result = $this->streams[$this->current]->read($remaining); + + // Using a loose comparison here to match on '', false, and null + if ($result == null) { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 00000000..af4d4c22 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,137 @@ +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + } + + public function getSize() + { + return strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof() + { + return strlen($this->buffer) === 0; + } + + public function tell() + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + // TODO: What should happen here? + if (strlen($this->buffer) >= $this->hwm) { + return false; + } + + return strlen($string); + } + + public function getMetadata($key = null) + { + if ($key == 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 00000000..ed68f086 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,138 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); + } + + public function getSize() + { + return max($this->stream->getSize(), $this->remoteStream->getSize()); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if ($whence == SEEK_SET) { + $byte = $offset; + } elseif ($whence == SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence == SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length) + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string) + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof() + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close() + { + $this->remoteStream->close() && $this->stream->close(); + } + + private function cacheEntireStream() + { + $target = new FnStream(['write' => 'strlen']); + copy_to_stream($this, $target); + + return $this->tell(); + } +} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 00000000..8935c80d --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,42 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string) + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/FnStream.php b/vendor/guzzlehttp/psr7/src/FnStream.php new file mode 100644 index 00000000..73daea6f --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/FnStream.php @@ -0,0 +1,158 @@ +methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * @throws \BadMethodCallException + */ + public function __get($name) + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * @throws \LogicException + */ + public function __wakeup() + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { + $methods[$diff] = [$stream, $diff]; + } + + return new self($methods); + } + + public function __toString() + { + return call_user_func($this->_fn___toString); + } + + public function close() + { + return call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize() + { + return call_user_func($this->_fn_getSize); + } + + public function tell() + { + return call_user_func($this->_fn_tell); + } + + public function eof() + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable() + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind() + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET) + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable() + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string) + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable() + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length) + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents() + { + return call_user_func($this->_fn_getContents); + } + + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 00000000..5e4f6028 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,52 @@ +read(10); + $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); + // Skip the header, that is 10 + length of filename + 1 (nil) bytes + $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); + $resource = StreamWrapper::getResource($stream); + stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } + + /** + * @param StreamInterface $stream + * @param $header + * @return int + */ + private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) + { + $filename_header_length = 0; + + if (substr(bin2hex($header), 6, 2) === '08') { + // we have a filename, read until nil + $filename_header_length = 1; + while ($stream->read(1) !== chr(0)) { + $filename_header_length++; + } + } + + return $filename_header_length; + } +} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 00000000..02cec3af --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,39 @@ +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + * + * @return StreamInterface + */ + protected function createStream() + { + return stream_for(try_fopen($this->filename, $this->mode)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 00000000..3c13d4f4 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,155 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof() + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit == -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + * {@inheritdoc} + */ + public function getSize() + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit == -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset % with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset($offset) + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit($limit) + { + $this->limit = $limit; + } + + public function read($length) + { + if ($this->limit == -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 00000000..1e4da649 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,183 @@ + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface */ + private $stream; + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header) + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + if (!is_array($value)) { + $value = [$value]; + } + + $value = $this->trimHeaderValues($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + if (!is_array($value)) { + $value = [$value]; + } + + $value = $this->trimHeaderValues($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = stream_for(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + return $new; + } + + private function setHeaders(array $headers) + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (!is_array($value)) { + $value = [$value]; + } + + $value = $this->trimHeaderValues($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + return trim($value, " \t"); + }, $values); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 00000000..c0fd584f --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,153 @@ +boundary = $boundary ?: sha1(uniqid('', true)); + $this->stream = $this->createStream($elements); + } + + /** + * Get the boundary + * + * @return string + */ + public function getBoundary() + { + return $this->boundary; + } + + public function isWritable() + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + */ + private function getHeaders(array $headers) + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements) + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(stream_for("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element) + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = stream_for($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if (substr($uri, 0, 6) !== 'php://') { + $element['filename'] = $uri; + } + } + + list($body, $headers) = $this->createElement( + $element['name'], + $element['contents'], + isset($element['filename']) ? $element['filename'] : null, + isset($element['headers']) ? $element['headers'] : [] + ); + + $stream->addStream(stream_for($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(stream_for("\r\n")); + } + + /** + * @return array + */ + private function createElement($name, StreamInterface $stream, $filename, array $headers) + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf('form-data; name="%s"; filename="%s"', + $name, + basename($filename)) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = $this->getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + if ($type = mimetype_from_filename($filename)) { + $headers['Content-Type'] = $type; + } + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 00000000..23322180 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,22 @@ +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + try { + return copy_to_string($this); + } catch (\Exception $e) { + return ''; + } + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 00000000..00066424 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,142 @@ +method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = stream_for($body); + } + } + + public function getRequestTarget() + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target == '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget) + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + return $new; + } + + public function getMethod() + { + return $this->method; + } + + public function withMethod($method) + { + $new = clone $this; + $new->method = strtoupper($method); + return $new; + } + + public function getUri() + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false) + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri() + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 00000000..6e72c06b --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,136 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode = 200; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|null|resource|StreamInterface $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + $status = 200, + array $headers = [], + $body = null, + $version = '1.1', + $reason = null + ) { + if (filter_var($status, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + + $this->statusCode = (int) $status; + + if ($body !== '' && $body !== null) { + $this->stream = stream_for($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::$phrases[$this->statusCode])) { + $this->reasonPhrase = self::$phrases[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = '') + { + $new = clone $this; + $new->statusCode = (int) $code; + if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { + $reasonPhrase = self::$phrases[$new->statusCode]; + } + $new->reasonPhrase = $reasonPhrase; + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 00000000..505e4742 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,18 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 00000000..99f453a5 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,376 @@ +serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files A array which respect $_FILES structure + * @throws InvalidArgumentException for unrecognized values + * @return array + */ + public static function normalizeFiles(array $files) + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * @return array|UploadedFileInterface + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @param array $files + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []) + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key], + 'error' => $files['error'][$key], + 'name' => $files['name'][$key], + 'type' => $files['type'][$key], + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + * + * @return ServerRequestInterface + */ + public static function fromGlobals() + { + $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new LazyOpenStream('php://input', 'r+'); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority($authority) + { + $uri = 'http://'.$authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = isset($parts['host']) ? $parts['host'] : null; + $port = isset($parts['port']) ? $parts['port'] : null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + * + * @return UriInterface + */ + public static function getUriFromGlobals() + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + + /** + * {@inheritdoc} + */ + public function getServerParams() + { + return $this->serverParams; + } + + /** + * {@inheritdoc} + */ + public function getUploadedFiles() + { + return $this->uploadedFiles; + } + + /** + * {@inheritdoc} + */ + public function withUploadedFiles(array $uploadedFiles) + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getCookieParams() + { + return $this->cookieParams; + } + + /** + * {@inheritdoc} + */ + public function withCookieParams(array $cookies) + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getQueryParams() + { + return $this->queryParams; + } + + /** + * {@inheritdoc} + */ + public function withQueryParams(array $query) + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + /** + * {@inheritdoc} + */ + public function withParsedBody($data) + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + /** + * {@inheritdoc} + */ + public function withAttribute($attribute, $value) + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withoutAttribute($attribute) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 00000000..111795eb --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,270 @@ + [ + 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, + 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, + 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a+' => true, 'rb+' => true, + ], + 'write' => [ + 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, + 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, 'rb+' => true, + 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true + ] + ]; + + /** + * This constructor accepts an associative array of options. + * + * - size: (int) If a read stream would otherwise have an indeterminate + * size, but the size is known due to foreknowledge, then you can + * provide that size, in bytes. + * - metadata: (array) Any additional metadata to return when the metadata + * of the stream is accessed. + * + * @param resource $stream Stream resource to wrap. + * @param array $options Associative array of options. + * + * @throws \InvalidArgumentException if the stream is not a stream resource + */ + public function __construct($stream, $options = []) + { + if (!is_resource($stream)) { + throw new \InvalidArgumentException('Stream must be a resource'); + } + + if (isset($options['size'])) { + $this->size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]); + $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + try { + $this->seek(0); + return (string) stream_get_contents($this->stream); + } catch (\Exception $e) { + return ''; + } + } + + public function getContents() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if ($contents === false) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close() + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize() + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + . $offset . ' with whence ' . var_export($whence, true)); + } + } + + public function read($length) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 00000000..daec6f52 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,149 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @param string $name Name of the property (allows "stream" only). + * + * @return StreamInterface + */ + public function __get($name) + { + if ($name == 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + // Really, PHP? https://bugs.php.net/bug.php?id=53648 + trigger_error('StreamDecorator::__toString exception: ' + . (string) $e, E_USER_ERROR); + return ''; + } + } + + public function getContents() + { + return copy_to_string($this); + } + + /** + * Allow decorators to implement custom methods + * + * @param string $method Missing method name + * @param array $args Method arguments + * + * @return mixed + */ + public function __call($method, array $args) + { + $result = call_user_func_array([$this->stream, $method], $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close() + { + $this->stream->close(); + } + + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize() + { + return $this->stream->getSize(); + } + + public function eof() + { + return $this->stream->eof(); + } + + public function tell() + { + return $this->stream->tell(); + } + + public function isReadable() + { + return $this->stream->isReadable(); + } + + public function isWritable() + { + return $this->stream->isWritable(); + } + + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $this->stream->seek($offset, $whence); + } + + public function read($length) + { + return $this->stream->read($length); + } + + public function write($string) + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @return StreamInterface + * @throws \BadMethodCallException + */ + protected function createStream() + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 00000000..0f3a2856 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,161 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @param StreamInterface $stream + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream] + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register() + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open($path, $mode, $options, &$opened_path) + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read($count) + { + return $this->stream->read($count); + } + + public function stream_write($data) + { + return (int) $this->stream->write($data); + } + + public function stream_tell() + { + return $this->stream->tell(); + } + + public function stream_eof() + { + return $this->stream->eof(); + } + + public function stream_seek($offset, $whence) + { + $this->stream->seek($offset, $whence); + + return true; + } + + public function stream_cast($cast_as) + { + $stream = clone($this->stream); + + return $stream->detach(); + } + + public function stream_stat() + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188 + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } + + public function url_stat($path, $flags) + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } +} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 00000000..e62bd5c8 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,316 @@ +setError($errorStatus); + $this->setSize($size); + $this->setClientFilename($clientFilename); + $this->setClientMediaType($clientMediaType); + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param mixed $streamOrFile + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile) + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @param int $error + * @throws InvalidArgumentException + */ + private function setError($error) + { + if (false === is_int($error)) { + throw new InvalidArgumentException( + 'Upload file error status must be an integer' + ); + } + + if (false === in_array($error, UploadedFile::$errors)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + /** + * @param int $size + * @throws InvalidArgumentException + */ + private function setSize($size) + { + if (false === is_int($size)) { + throw new InvalidArgumentException( + 'Upload file size must be an integer' + ); + } + + $this->size = $size; + } + + /** + * @param mixed $param + * @return boolean + */ + private function isStringOrNull($param) + { + return in_array(gettype($param), ['string', 'NULL']); + } + + /** + * @param mixed $param + * @return boolean + */ + private function isStringNotEmpty($param) + { + return is_string($param) && false === empty($param); + } + + /** + * @param string|null $clientFilename + * @throws InvalidArgumentException + */ + private function setClientFilename($clientFilename) + { + if (false === $this->isStringOrNull($clientFilename)) { + throw new InvalidArgumentException( + 'Upload file client filename must be a string or null' + ); + } + + $this->clientFilename = $clientFilename; + } + + /** + * @param string|null $clientMediaType + * @throws InvalidArgumentException + */ + private function setClientMediaType($clientMediaType) + { + if (false === $this->isStringOrNull($clientMediaType)) { + throw new InvalidArgumentException( + 'Upload file client media type must be a string or null' + ); + } + + $this->clientMediaType = $clientMediaType; + } + + /** + * Return true if there is no upload error + * + * @return boolean + */ + private function isOk() + { + return $this->error === UPLOAD_ERR_OK; + } + + /** + * @return boolean + */ + public function isMoved() + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive() + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + /** + * {@inheritdoc} + * @throws RuntimeException if the upload was not successful. + */ + public function getStream() + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + return new LazyOpenStream($this->file, 'r+'); + } + + /** + * {@inheritdoc} + * + * @see http://php.net/is_uploaded_file + * @see http://php.net/move_uploaded_file + * @param string $targetPath Path to which to move the uploaded file. + * @throws RuntimeException if the upload was not successful. + * @throws InvalidArgumentException if the $path specified is invalid. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. + */ + public function moveTo($targetPath) + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = php_sapi_name() == 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + copy_to_stream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + /** + * {@inheritdoc} + * + * @return int|null The file size in bytes or null if unknown. + */ + public function getSize() + { + return $this->size; + } + + /** + * {@inheritdoc} + * + * @see http://php.net/manual/en/features.file-upload.errors.php + * @return int One of PHP's UPLOAD_ERR_XXX constants. + */ + public function getError() + { + return $this->error; + } + + /** + * {@inheritdoc} + * + * @return string|null The filename sent by the client or null if none + * was provided. + */ + public function getClientFilename() + { + return $this->clientFilename; + } + + /** + * {@inheritdoc} + */ + public function getClientMediaType() + { + return $this->clientMediaType; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 00000000..36219568 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,738 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; + private static $charSubDelims = '!\$&\'\(\)\*\+,;='; + private static $replaceQuery = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** + * @param string $uri URI to parse + */ + public function __construct($uri = '') + { + // weak type check to also accept null until we can add scalar type hints + if ($uri != '') { + $parts = parse_url($uri); + if ($parts === false) { + throw new \InvalidArgumentException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + public function __toString() + { + return self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @param string $scheme + * @param string $authority + * @param string $path + * @param string $query + * @param string $fragment + * + * @return string + * + * @link https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents($scheme, $authority, $path, $query, $fragment) + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme . ':'; + } + + if ($authority != ''|| $scheme === 'file') { + $uri .= '//' . $authority; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?' . $query; + } + + if ($fragment != '') { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + * + * @param UriInterface $uri + * + * @return bool + */ + public static function isDefaultPort(UriInterface $uri) + { + return $uri->getPort() === null + || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @param UriInterface $uri + * + * @return bool + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @link https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri) + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @param UriInterface $uri + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri) + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @param UriInterface $uri + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @param UriInterface $uri + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Removes dot segments from a path and returns the new path. + * + * @param string $path + * + * @return string + * + * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. + * @see UriResolver::removeDotSegments + */ + public static function removeDotSegments($path) + { + return UriResolver::removeDotSegments($path); + } + + /** + * Converts the relative URI into a new URI that is resolved against the base URI. + * + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI + * + * @return UriInterface + * + * @deprecated since version 1.4. Use UriResolver::resolve instead. + * @see UriResolver::resolve + */ + public static function resolve(UriInterface $base, $rel) + { + if (!($rel instanceof UriInterface)) { + $rel = new self($rel); + } + + return UriResolver::resolve($base, $rel); + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + * + * @return UriInterface + */ + public static function withoutQueryValue(UriInterface $uri, $key) + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + * + * @return UriInterface + */ + public static function withQueryValue(UriInterface $uri, $key, $value) + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + * + * @return UriInterface + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray) + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString($key, $value); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @param array $parts + * + * @return UriInterface + * @link http://php.net/manual/en/function.parse-url.php + * + * @throws \InvalidArgumentException If the components do not form a valid URI. + */ + public static function fromParts(array $parts) + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme() + { + return $this->scheme; + } + + public function getAuthority() + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo . '@' . $authority; + } + + if ($this->port !== null) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getPath() + { + return $this->path; + } + + public function getQuery() + { + return $this->query; + } + + public function getFragment() + { + return $this->fragment; + } + + public function withScheme($scheme) + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null) + { + $info = $user; + if ($password != '') { + $info .= ':' . $password; + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->validateState(); + + return $new; + } + + public function withHost($host) + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->validateState(); + + return $new; + } + + public function withPort($port) + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path) + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->validateState(); + + return $new; + } + + public function withQuery($query) + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment) + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts) + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) ? $parts['user'] : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $parts['pass']; + } + + $this->removeDefaultPort(); + } + + /** + * @param string $scheme + * + * @return string + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme) + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return strtolower($scheme); + } + + /** + * @param string $host + * + * @return string + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host) + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return strtolower($host); + } + + /** + * @param int|null $port + * + * @return int|null + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port) + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (1 > $port || 0xffff < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 1 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param UriInterface $uri + * @param array $keys + * + * @return array + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys) + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + /** + * @param string $key + * @param string|null $value + * + * @return string + */ + private static function generateQueryString($key, $value) + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::$replaceQuery); + + if ($value !== null) { + $queryString .= '=' . strtr($value, self::$replaceQuery); + } + + return $queryString; + } + + private function removeDefaultPort() + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param string $path + * + * @return string + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path) + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param string $str + * + * @return string + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str) + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match) + { + return rawurlencode($match[0]); + } + + private function validateState() + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + @trigger_error( + 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . + 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', + E_USER_DEPRECATED + ); + $this->path = '/'. $this->path; + //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 00000000..384c29e5 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,216 @@ +getPath() === '' && + ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri) + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri) + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 00000000..c1cb8a27 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,219 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/' . $rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + * + * @param UriInterface $base Base URI + * @param UriInterface $target Target URI + * + * @return UriInterface The relative URI reference + */ + public static function relativize(UriInterface $base, UriInterface $target) + { + if ($target->getScheme() !== '' && + ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target) + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/functions.php b/vendor/guzzlehttp/psr7/src/functions.php new file mode 100644 index 00000000..8e6dafe6 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/functions.php @@ -0,0 +1,899 @@ +getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + + return "{$msg}\r\n\r\n" . $message->getBody(); +} + +/** + * Returns a UriInterface for the given value. + * + * This function accepts a string or {@see Psr\Http\Message\UriInterface} and + * returns a UriInterface for the given value. If the value is already a + * `UriInterface`, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * @throws \InvalidArgumentException + */ +function uri_for($uri) +{ + if ($uri instanceof UriInterface) { + return $uri; + } elseif (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); +} + +/** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data + * @param array $options Additional options + * + * @return StreamInterface + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ +function stream_for($resource = '', array $options = []) +{ + if (is_scalar($resource)) { + $stream = fopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + return new Stream($resource, $options); + case 'object': + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return stream_for((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(fopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); +} + +/** + * Parse an array of header values containing ";" separated data into an + * array of associative arrays representing the header key value pair + * data of the header. When a parameter does not contain a value, but just + * contains a key, this function will inject a key with a '' string value. + * + * @param string|array $header Header to parse into components. + * + * @return array Returns the parsed header values. + */ +function parse_header($header) +{ + static $trimmed = "\"' \n\t\r"; + $params = $matches = []; + + foreach (normalize_header($header) as $val) { + $part = []; + foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { + if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; +} + +/** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @return array Returns the normalized header field values. + */ +function normalize_header($header) +{ + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; +} + +/** + * Clone and modify a request with the given changes. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + * + * @return RequestInterface + */ +function modify_request(RequestInterface $request, array $changes) +{ + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':'.$port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = _caseless_remove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = _caseless_remove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + return (new ServerRequest( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + } + + return new Request( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion() + ); +} + +/** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` returns a + * value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ +function rewind_body(MessageInterface $message) +{ + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } +} + +/** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * @throws \RuntimeException if the file cannot be opened + */ +function try_fopen($filename, $mode) +{ + $ex = null; + set_error_handler(function () use ($filename, $mode, &$ex) { + $ex = new \RuntimeException(sprintf( + 'Unable to open %s using mode %s: %s', + $filename, + $mode, + func_get_args()[1] + )); + }); + + $handle = fopen($filename, $mode); + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; +} + +/** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * @return string + * @throws \RuntimeException on error. + */ +function copy_to_string(StreamInterface $stream, $maxLen = -1) +{ + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; +} + +/** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ +function copy_to_stream( + StreamInterface $source, + StreamInterface $dest, + $maxLen = -1 +) { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } +} + +/** + * Calculate a hash of a Stream + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * @throws \RuntimeException on error. + */ +function hash( + StreamInterface $stream, + $algo, + $rawOutput = false +) { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; +} + +/** + * Read a line from the stream up to the maximum allowed buffer length + * + * @param StreamInterface $stream Stream to read from + * @param int $maxLength Maximum buffer length + * + * @return string + */ +function readline(StreamInterface $stream, $maxLength = null) +{ + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + // Using a loose equality here to match on '' and false. + if (null == ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; +} + +/** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + * + * @return Request + */ +function parse_request($message) +{ + $data = _parse_message($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); +} + +/** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + * + * @return Response + */ +function parse_response($message) +{ + $data = _parse_message($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + isset($parts[2]) ? $parts[2] : null + ); +} + +/** + * Parse a query string into an associative array. + * + * If multiple values are found for the same key, the value of that key + * value pair will become an array. This function does not parse nested + * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will + * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']). + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + */ +function parse_query($str, $urlEncoding = true) +{ + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { return $str; }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; +} + +/** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of parse_query() to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like http_build_query would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * @return string + */ +function build_query(array $params, $encoding = PHP_QUERY_RFC3986) +{ + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function ($str) { return $str; }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; +} + +/** + * Determines the mimetype of a file by looking at its extension. + * + * @param $filename + * + * @return null|string + */ +function mimetype_from_filename($filename) +{ + return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION)); +} + +/** + * Maps a file extensions to a mimetype. + * + * @param $extension string The file extension. + * + * @return string|null + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + */ +function mimetype_from_extension($extension) +{ + static $mimetypes = [ + '3gp' => 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mkv' => 'video/x-matroska', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; +} + +/** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + * @internal + */ +function _parse_message($message) +{ + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + list($rawHeaders, $body) = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + list($startLine, $rawHeaders) = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; +} + +/** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + * @internal + */ +function _parse_request_uri($path, array $headers) +{ + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); +} + +/** + * Get a short summary of the message body + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return null|string + */ +function get_message_body_summary(MessageInterface $message, $truncateAt = 120) +{ + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) { + return null; + } + + return $summary; +} + +/** @internal */ +function _caseless_remove($keys, array $data) +{ + $result = []; + + foreach ($keys as &$key) { + $key = strtolower($key); + } + + foreach ($data as $k => $v) { + if (!in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; +} diff --git a/vendor/guzzlehttp/psr7/src/functions_include.php b/vendor/guzzlehttp/psr7/src/functions_include.php new file mode 100644 index 00000000..96a4a83a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/functions_include.php @@ -0,0 +1,6 @@ += 5.4` + +## Installation + +``` bash +composer require mailjet/Mailjet-iframe-v3 +``` + +## Getting Started ! + +[grab][api_credential] your API credentials and use them to connect Mailjet API. + +It's as easy as 1, 2, 3 ! + + +## A basic example + +``` php +setCallback('') + ->setTokenExpiration(600) + ->setLocale('fr_FR') + ->setTokenAccess(array( + 'campaigns', + 'contacts', + 'stats', + 'email_automation', + )) + ->turnDocumentationProperties(MailjetIframe::OFF) + ->turnNewContactListCreation(MailjetIframe::OFF) + ->turnMenu(MailjetIframe::ON) + ->turnFooter(MailjetIframe::OFF) + ->turnBar(MailjetIframe::ON) + ->turnCreateCampaignButton(MailjetIframe::ON) + ->turnSendingPolicy(MailjetIframe::OFF) + ->setInitialPage(MailjetIframe::PAGE_STATS); + +/** + * + * Show the iframe wherever you want + */ +echo $mailjetIframe->getHtml(); +``` +* Available initial pages: PAGE_STATS, PAGE_CAMPAIGNS, PAGE_CONTACTS, PAGE_AUTOMATION + +## Send a pull request + + - Fork the project. + - Create a topic branch. + - Implement your feature/bug fix. + - Add documentation for your feature or bug fix. + - Add specs for your feature or bug fix. + - Commit and push your changes. + - Submit a pull request. diff --git a/vendor/mailjet/Mailjet-iframe-v3/composer.json b/vendor/mailjet/Mailjet-iframe-v3/composer.json new file mode 100644 index 00000000..f39a6287 --- /dev/null +++ b/vendor/mailjet/Mailjet-iframe-v3/composer.json @@ -0,0 +1,22 @@ +{ + "name": "mailjet/Mailjet-iframe-v3", + "description": "Mailjet iFrame wrapper", + "keywords": ["mailjet", "iframe", "marketing", "api", "campaign", "php", "email"], + "homepage": "https://github.com/mailjet/Mailjet-iframe-v3/", + "license": "MIT", + "authors": [ + { + "name": "Mailjet", + "email": "dev@mailjet.com", + "homepage": "https://dev.mailjet.com" + } + ], + "require": { + "php": ">=5.4.0" + }, + "autoload": { + "psr-4": { + "MailjetIframe\\": "src" + } + } +} diff --git a/vendor/mailjet/Mailjet-iframe-v3/example.php b/vendor/mailjet/Mailjet-iframe-v3/example.php new file mode 100644 index 00000000..13c5c20c --- /dev/null +++ b/vendor/mailjet/Mailjet-iframe-v3/example.php @@ -0,0 +1,43 @@ +setCallback('') + ->setTokenExpiration(600) + ->setLocale('fr_FR') + ->setTokenAccess(array( + 'campaigns', + 'contacts', + 'stats', + 'email_automation', + )) + ->turnDocumentationProperties(MailjetIframe::OFF) + ->turnNewContactListCreation(MailjetIframe::OFF) + ->turnMenu(MailjetIframe::ON) + ->turnFooter(MailjetIframe::OFF) + ->turnBar(MailjetIframe::ON) + ->turnCreateCampaignButton(MailjetIframe::ON) + ->turnSendingPolicy(MailjetIframe::OFF) + ->setInitialPage(MailjetIframe::PAGE_STATS); + +/** + * + * Show the iframe whereever you want + */ +echo $mailjetIframe->getHtml(); diff --git a/vendor/mailjet/Mailjet-iframe-v3/src/MailjetApi.php b/vendor/mailjet/Mailjet-iframe-v3/src/MailjetApi.php new file mode 100644 index 00000000..c948e087 --- /dev/null +++ b/vendor/mailjet/Mailjet-iframe-v3/src/MailjetApi.php @@ -0,0 +1,895 @@ +_apiKey = $apiKey; + } + if ($secretKey) { + $this->_secretKey = $secretKey; + } + $this->_apiUrl = (($this->_secure) ? 'https' : 'http') . '://api' . $this->env . 'mailjet.com/v3/' . $this->_version; + } + + /** + * Singleton pattern : + * Get the instance of the object if it already exists + * or create a new one. + * + * @access public + * @uses Mailjet::Api::$_instance + * + * @return resource instance + */ + public static function getInstance() + { + if (!(self::$_instance instanceof self)) { + self::$_instance = new self(); + } + + return self::$_instance; + } + + /** + * + * @param unknown_type $version + */ + public function data($method, $id, $type = 'HTML', $contType = 'text:html', $params = array(), $request = 'GET', $lastID = null) + { + $is_json_put = (isset($params['ID']) && !empty($params['ID'])); + if ($this->_debug != 0) { + $this->_debugMethod = $method; + $this->_debugRequest = $request; + } + + $this->_debugCallUrl = $this->_apiUrl = $url = (($this->_secure) ? 'https' : 'http') . '://api' . $this->env . 'mailjet.com/v3/DATA/' . $method . '/' . $id . '/' . $type + . '/' . $contType; + + + if (is_null($this->_curl_handle)) { + $this->_curl_handle = curl_init(); + } + + curl_setopt($this->_curl_handle, CURLOPT_URL, $url); + curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array("Content-Type: " . $contType)); + curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYHOST, 2); + + curl_setopt($this->_curl_handle, CURLOPT_USERPWD, $this->_apiKey . ':' . $this->_secretKey); + + if ($lastID) { + $this->_debugCallUrl = $this->_apiUrl = $this->_apiUrl . '/' . $lastID; + } + + switch ($request) { + case 'GET' : + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'GET'); + curl_setopt($this->_curl_handle, CURLOPT_HTTPGET, TRUE); + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, NULL); + $this->_request_post = FALSE; + break; + case 'POST': + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'POST'); + curl_setopt($this->_curl_handle, CURLOPT_POST, count($params)); + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, $params); + $this->_request_post = $params; + break; + case 'PUT': + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, $params); + break; + case 'DELETE': + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'DELETE'); + /*curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, http_build_query($params, '', '&'));*/ + $this->_request_post = $params; + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, json_encode($this->_request_post)); + curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen(json_encode($this->_request_post)) + ) + ); + break; + case 'JSON': + if ($is_json_put) { + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, "PUT"); + } else { + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, "POST"); + } + + $this->_request_post = $params; + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, json_encode($this->_request_post)); + curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen(json_encode($this->_request_post)) + ) + ); + break; + } + curl_setopt($this->_curl_handle, CURLOPT_URL, $this->_apiUrl); + + $buffer = curl_exec($this->_curl_handle); + + if ($this->_debug > 2) { + var_dump($buffer); + } + + $this->_response_code = curl_getinfo($this->_curl_handle, CURLINFO_HTTP_CODE); + $this->_response = $buffer; + + if ($this->_debug > 0) { + $this->debug(); + } + + // echo '
    ';
    +        // var_dump($this->_response);
    +        // echo '
    '; + + return ($this->_response_code == 200) ? $this : FALSE; + + } + + /** + * Destructor + * + * Close the cURL handle resource + * + * @access public + * @uses Mailjet::Api::$_curl_handle + */ + public function __destruct() + { + if (!is_null($this->_curl_handle)) { + curl_close($this->_curl_handle); + } + $this->_curl_handle = NULL; + } + + /** + * Update or set consumer keys + * + * @access public + * @uses Mailjet::Api::$_apiKey + * @uses Mailjet::Api::$_secretKey + * @param string $apiKey Mailjet API Key + * @param string $secretKey Mailjet API Secret Key + */ + public function setKeys($apiKey, $secretKey) + { + $this->_apiKey = $apiKey; + $this->_secretKey = $secretKey; + } + + /** + * Get the API Key + * + * @access public + * @uses Mailjet::Api::$_apiKey + * + * @return string Api Key + */ + public function getAPIKey() + { + return ($this->_apiKey); + } + + /** + * Secure or not the transaction through https + * + * @access public + * @uses Mailjet::Api::$_apiUrl + * @param boolean $secure TRUE to secure the transaction, FALSE otherwise + */ + public function secure($secure = TRUE) + { + $this->_secure = $secure; + $protocol = 'http'; + if ($secure) { + $protocol = 'https'; + } + $this->_apiUrl = preg_replace('/http(s)?:\/\//', $protocol . '://', $this->_apiUrl); + } + + /** + * Get the last Response HTTP Code + * + * @access public + * @uses Mailjet::Api::$_response_code + * @return integer last Response HTTP Code + */ + public function getHTTPCode() + { + return ($this->_response_code); + } + + /** + * Get the response from the last call + * + * @access public + * @uses Mailjet::Api::$_response + * @return mixed Response from the last call + */ + public function getResponse() + { + return ($this->_response); + } + + /** + * Get the last error as a HTML table + * + * @access public + * @uses Mailjet::Api::$_debugErrorHtml + * @return string last Error as a HTML table + */ + public function getErrorHtml() + { + return ($this->_debugErrorHtml); + } + + /** + * Set the current API output format + * + * @access public + * @param string $output API output format + */ + public function setOutput($output) + { + $this->_output = $output; + } + + /** + * Get the current API output format + * + * @access public + * + * @return string API output format + */ + public function getOutput() + { + return ($this->_output); + } + + /** + * Set the debug flag : + * 0 none / 1 errors only / 2 all + * + * @access public + * @param integer $debug Debug flag + */ + public function setDebugFlag($debug) + { + $this->_debug = $debug; + } + + /** + * Get the debug flag : + * 0 none / 1 errors only / 2 all + * + * @access public + * + * @return integer Debug flag + */ + public function getDebugFlag() + { + return ($this->_debug); + } + + /** + * Set the default nb of seconds before updating the cached object + * If set to 0, Object caching will be disabled + * + * @access public + * @uses Mailjet::Api::$_cache + * @param integer $cache Cache to set in seconds + */ + public function setCachePeriod($cache) + { + $this->_cache = $cache; + } + + /** + * Get the default nb of seconds before updating the cached object + * If set to 0, Object caching will be disabled + * + * @access public + * @uses Mailjet::Api::$_cache + * + * @return integer Cache in seconds + */ + public function getCachePeriod() + { + return ($this->_cache); + } + + /** + * Set the Cache path + * + * @access public + * @uses Mailjet::Api::$_cache_path + * @param string $cache_path path to the cached objects + * + * @return boolean TRUE if the path is successfully set, FALSE otherwise + */ + public function setCachePath($cache_path) + { + @mkdir($cache_path); + if (is_dir($cache_path)) { + $this->_cache_path = rtrim($cache_path, '/') . '/'; + + return (TRUE); + } + + return (FALSE); + } + + /** + * Get the cache path + * + * @access public + * @uses Mailjet::Api::$_cache_path + * + * @return string path to the cached objects + */ + public function getCachePath() + { + return ($this->_cache_path); + } + + public function resetRequest() + { + $this->_apiUrl = (($this->_secure) ? 'https' : 'http') . '://api' . $this->env . 'mailjet.com/v3/' . $this->_version; + $this->_request_post = false; + } + + /** + * Read object from cache if available and not outdated + * + * @access private + * @uses Mailjet::Api::$_cache + * @uses Mailjet::Api::$_cache_path + * @param string $object Object or collection of resources you want to access + * @param array $params Additional parameters for the request + * @param string $request cURL request method (GET | POST) + * + * @return mixed Cached object, NULL otherwise + */ + private function readCache($object, $params, $request) + { + if (isset($params['cache'])) { + $cache = $params['cache']; + unset($params['cache']); + } else { + $cache = $this->_cache; + } + if ($request == 'GET' && $cache != 0) { + sort($params); + $file = $object . '.' . hash('md5', + $this->_apiKey . http_build_query($params, '', '')) . '.' . $this->_output; + if (file_exists($this->_cache_path . $file)) { + $data = unserialize(file_get_contents($this->_cache_path . $file)); + if ($data['timestamp'] > time() - $cache) { + return ($data['result']); + } + } + } + + return (NULL); + } + + /** + * Write object to cache + * + * @access private + * @uses Mailjet::Api::$_cache + * @uses Mailjet::Api::$_cache_path + * @param string $object Object or collection of resources you want to access + * @param array $params Additional parameters for the request + * @param string $request cURL request method (GET | POST) + * @param string $result Result of the cURL request + */ + private function writeCache($object, $params, $request, $result) + { + if (isset($params['cache'])) { + $cache = $params['cache']; + unset($params['cache']); + } else { + $cache = $this->_cache; + } + if ($request == 'GET' && $cache != 0) { + sort($params); + $file = $object . '.' . hash('md5', + $this->_apiKey . http_build_query($params, '', '')) . '.' . $this->_output; + $data = array('timestamp' => time(), 'result' => $result); + file_put_contents($this->_cache_path . $file, serialize($data)); + } + } + + /** + * Make the magic call ;) + * + * Check for arguments and order them before sending the request. + * + * @access public + * @uses Mailjet::Api::$_debug + * @uses Mailjet::Api::debug() to display the debug output + * @uses Mailjet::Api::sendRequest() to send the request + * @param string $method Method to call + * @param array $args Array of parameters + * + * @return mixed array with the status of the response + * and the result of the request OR FALSE on failure. + */ + public function __call($method, $args) + { + $params = (sizeof($args) > 0) ? $args[0] : array(); + $request = isset($params["method"]) ? strtoupper($params["method"]) : 'GET'; + if (isset($params["method"])) { + unset($params["method"]); + } + $result = $this->readCache($method, $params, $request); + if (is_null($result)) { + if ($result = $this->sendRequest($method, $params, $request)) { + $this->writeCache($method, $params, $request, $this->_response); + } + } else { + return ($this); + } + + $return = ($result === TRUE) ? $this->_response : FALSE; + if ($this->_debug == 2 || ($this->_debug == 1 && $return == FALSE)) { + $this->debug(); + } + + return $this; + } + + /** + * Build the full Url for the request + * + * @access private + * @uses Mailjet::Api::$_apiUrl + * @uses Mailjet::Api::$_debugCallUrl + * @param string $method Method to call + * @param array $params Additional parameters for the request + * @param string $request Request method + * + * @return string Full built Url for the request + */ + private function requestUrlBuilder($method, $params, $request) + { + $query_string = array(); + foreach ($params as $key => $value) { + if ($request == "GET" || in_array($key, array('apikey', 'output'))) { + $query_string[$key] = $key . '=' . urlencode($value); + } + if ($key == "output") { + $this->_output = $value; + } + } + $query_string['output'] = 'output=' . urlencode($this->_output); + + if (isset($params['ID']) && $params['ID']) { + $id = $params['ID']; + unset($params['ID']); + $this->_debugCallUrl = $this->_apiUrl . '/' . $method . '/' . $id . '?' . join('&', $query_string); + } else { + $this->_debugCallUrl = $this->_apiUrl . '/' . $method . '/?' . join('&', $query_string); + } + + return $this->_debugCallUrl; + } + + /** + * Send Request + * + * Send the request to the Mailjet API server and get back the result + * Basically, setup and execute the curl process + * + * @access private + * @uses Mailjet::Api::$_debug + * @uses Mailjet::Api::$_apiKey + * @uses Mailjet::Api::$_secretKey + * @uses Mailjet::Api::$_curl_handle + * @uses Mailjet::Api::requestUrlBuilder() to build the full Url for the request + * @param string $method Method to call + * @param array $params Additional parameters for the request + * @param string $request Request method + * + * @return string the result of the request + */ + private function sendRequest($method = FALSE, $params = array(), $request = "GET", $url = false) + { + $is_json_put = (isset($params['ID']) && !empty($params['ID'])); + + if ($this->_debug != 0) { + $this->_debugMethod = $method; + $this->_debugRequest = $request; + } + + if ($url == false) { + $url = $this->requestUrlBuilder($method, $params, $request); + } + + if (is_null($this->_curl_handle)) { + $this->_curl_handle = curl_init(); + } + + curl_setopt($this->_curl_handle, CURLOPT_URL, $url); + curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($this->_curl_handle, CURLOPT_TIMEOUT, 10); //timeout in seconds + curl_setopt($this->_curl_handle, CURLOPT_USERPWD, $this->_apiKey . ':' . $this->_secretKey); + + switch ($request) { + case 'GET' : + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'GET'); + curl_setopt($this->_curl_handle, CURLOPT_HTTPGET, TRUE); + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, NULL); + $this->_request_post = FALSE; + break; + case 'POST': + if (isset($params['Action']) && isset($params['ListID'])) { + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'POST'); + } else { + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'JSON'); + } + + curl_setopt($this->_curl_handle, CURLOPT_POST, count($params)); + if (isset($params['Action']) && isset($params['ListID'])) { + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, json_encode($params)); + curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); + } else { + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, http_build_query($params, '', '&')); + } + + $this->_request_post = $params; + break; + case 'PUT': + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, http_build_query($params, '', '&')); + break; + case 'DELETE': + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, 'DELETE'); + /*curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, http_build_query($params, '', '&'));*/ + $this->_request_post = $params; + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, json_encode($this->_request_post)); + curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen(json_encode($this->_request_post)) + ) + ); + break; + case 'JSON': + if ($is_json_put) { + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, "PUT"); + } else { + curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, "POST"); + } + + $this->_request_post = $params; + curl_setopt($this->_curl_handle, CURLOPT_POSTFIELDS, json_encode($this->_request_post)); + curl_setopt($this->_curl_handle, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($this->_curl_handle, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen(json_encode($this->_request_post)) + ) + ); + break; + } + + $buffer = curl_exec($this->_curl_handle); + + if ($this->_debug > 2) { + var_dump($buffer); + } + + $this->_response_code = curl_getinfo($this->_curl_handle, CURLINFO_HTTP_CODE); + $this->_response = ($this->_output == 'json') ? json_decode($buffer) : $buffer; + + return ($this->_response_code == 200) ? TRUE : FALSE; + } + + + /** + * Display debugging information + * + * @access private + * @uses Mailjet::Api::$_response + * @uses Mailjet::Api::$_response_code + * @uses Mailjet::Api::$_debugCallUrl + * @uses Mailjet::Api::$_debugMethod + * @uses Mailjet::Api::$_debugRequest + * @uses Mailjet::Api::$_request_post + */ + private function debug() + { + $this->_debugErrorHtml = ''; + + $this->_debugErrorHtml .= '
    '; + + if (isset($this->_response_code)) { + if ($this->_response_code == 200) { + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + if (isset($this->_response)) { + $this->_debugErrorHtml .= ''; + } + $this->_debugErrorHtml .= '
    Success
    Status code' . $this->_response_code . '
    Response
    ' . utf8_decode(print_r($this->_response,
    +                            1)) . '
    '; + } elseif ($this->_response_code == 304) { + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= '
    Error
    Error no' . $this->_response_code . '
    MessageNot Modified
    '; + } else { + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + if (isset($this->_response)) { + if (is_array($this->_response) OR is_object($this->_response)) { + $this->_debugErrorHtml .= ''; + } else { + $this->_debugErrorHtml .= ''; + } + } + $this->_debugErrorHtml .= '
    Error
    Error no' . $this->_response_code . '
    Status
    ' . print_r($this->_response,
    +                                TRUE) . '
    Status
    ' . $this->_response . '
    '; + } + } + + $call_url = parse_url($this->_debugCallUrl); + + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= '
    API config
    Protocole' . $call_url['scheme'] . '
    Host' . $call_url['host'] . '
    Version' . $this->_version . '
    '; + + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= ''; + + if ($this->_request_post && sizeof($this->_request_post) > 0) { + $this->_debugErrorHtml .= ''; + } + + $this->_debugErrorHtml .= ''; + $this->_debugErrorHtml .= '
    Call infos
    Method' . $this->_debugMethod . '
    Request type' . $this->_debugRequest . '
    Get Arguments'; + + $args = array(); + if (isset($call_url['query'])) { + $args = explode("&", $call_url['query']); + } + + if (sizeof($args) > 0) { + foreach ($args as $arg) { + $arg = explode("=", $arg); + $this->_debugErrorHtml .= '' . $arg[0] . ' = ' . $arg[1] . '
    '; + } + } + + $this->_debugErrorHtml .= '
    Post Arguments'; + + foreach ($this->_request_post as $k => $v) { + $this->_debugErrorHtml .= $k . ' = ' . $v . '
    '; + } + + $this->_debugErrorHtml .= '
    Call url' . $this->_debugCallUrl . '
    '; + + $this->_debugErrorHtml .= '
    '; + + if ($this->_debugEcho) { + echo $this->_debugErrorHtml; + } + } +} diff --git a/vendor/mailjet/Mailjet-iframe-v3/src/MailjetException.php b/vendor/mailjet/Mailjet-iframe-v3/src/MailjetException.php new file mode 100644 index 00000000..8fee3129 --- /dev/null +++ b/vendor/mailjet/Mailjet-iframe-v3/src/MailjetException.php @@ -0,0 +1,12 @@ +startSession(); + } + $this->mailjetApi = new MailjetApi($apitKey, $secretKey); + } + + /** + * Turn email footer signature on/off + * @param string $flag + */ + public function turnFooter($flag) + { + $this->showFooter = $flag; + + return $this; + } + + /** + * + * @param integer $seconds + * @return \MailjetIframe + */ + public function setTokenExpiration($seconds = 600) + { + if (!is_numeric($seconds)) { + throw new MailjetException( + "Token expiration should be a valid number." + ); + } + + if ($seconds <= 0) { + throw new MailjetException( + "Token expiration should be greater than 0" + ); + } + + $this->sessionExpiration = $seconds; + return $this; + } + + /** + * + * @param string $callback + * @param boolean $isEncoded + * @return \MailjetIframe + */ + public function setCallback($callback = '', $isEncoded = false) + { + if ($isEncoded) { + $this->callback = $callback; + } else { + $this->callback = urldecode($callback); + } + + return $this; + } + + /** + * + * @param string $locale + * @return \MailjetIframe + * @throws MailjetException + */ + public function setLocale($locale = 'fr_FR') + { + if (!in_array($locale, $this->locales)) { + throw new MailjetException( + "{$locale} is not supported." + ); + } + + $this->locale = $locale; + return $this; + } + + /** + * + * @param array $access + * @return \MailjetIframe + */ + public function setTokenAccess(array $access = array()) + { + foreach ($access as $value) { + if (!in_array($value, $this->tokenAccessAvailable)) { + throw new MailjetException( + "{$value} is not a valid token access." + ); + } + } + + $this->tokenAccess = implode(', ', $access); + return $this; + } + + /** + * + * @param string $flag + * @return \MailjetIframe + * @throws MailjetException + */ + public function turnDocumentationProperties($flag = self::ON) + { + if (!$this->isAllowedOnOffParameter($flag)) { + throw new MailjetException( + "Documentation properties requires a valid on/off parameter." + ); + } + + $this->documentationProperties = $flag; + return $this; + } + + /** + * + * @param string $flag + * @return \MailjetIframe + * @throws MailjetException + */ + public function turnNewContactListCreation($flag = self::ON) + { + if (!$this->isAllowedOnOffParameter($flag)) { + throw new MailjetException( + "New contact list creation requires a valid on/off parameter." + ); + } + + $this->newContactListCreation = $flag; + return $this; + } + + /** + * + * @param string $flag + * @return \MailjetIframe + * @throws MailjetException + */ + public function turnMenu($flag = self::ON) + { + if (!$this->isAllowedOnOffParameter($flag)) { + throw new MailjetException( + "Menu requires a valid on/off parameter." + ); + } + + $this->menu = $flag; + return $this; + } + + /** + * + * @param string $flag + * @return \MailjetIframe + * @throws MailjetException + */ + public function turnBar($flag = self::ON) + { + if (!$this->isAllowedOnOffParameter($flag)) { + throw new MailjetException( + "Bar requires a valid on/off parameter." + ); + } + + $this->showBar = $flag; + return $this; + } + + + /** + * + * @param string $flag + * @return \MailjetIframe + * @throws MailjetException + */ + public function turnCreateCampaignButton($flag = self::ON) + { + if (!$this->isAllowedOnOffParameter($flag)) { + throw new MailjetException( + "Create campaign requires a valid on/off parameter." + ); + } + + $this->crc = $flag; + return $this; + } + + + /** + * + * @param string $flag + * @return \MailjetIframe + * @throws MailjetException + */ + public function turnSendingPolicy($flag = self::ON) + { + if (!$this->isAllowedOnOffParameter($flag)) { + throw new MailjetException( + "Sending policy requires a valid on/off parameter." + ); + } + + $this->sp = $flag; + return $this; + } + + + /** + * + * @param string $page + * @return \MailjetIframe + * @throws MailjetException + */ + public function setInitialPage($page = self::PAGE_STATS) + { + if (!in_array($page, $this->allowedPages)) { + throw new MailjetException( + "{$page} is uknown." + ); + } + + $this->initialPage = $page; + return $this; + } + + /** + * + * @return string + */ + public function getHtml() + { + $iframeUrl = $this->getIframeUrl(); + + $html = << + + +HTML; + + return sprintf($html, '%', '%', $iframeUrl); + } + + /** + * + * @param mixed $parameter + * @return boolean + */ + private function isAllowedOnOffParameter($parameter) + { + if ($parameter !== self::ON && $parameter !== self::OFF) { + return false; + } + + return true; + } + + /** + * + * @return string + * @throws MailjetException + */ + private function getToken() + { + if (!isset($_SESSION[self::SESSION_NAME])) { + + $_SESSION[self::SESSION_NAME] = $this->generateToken(); + $_SESSION[self::SESSION_SET] = time(); + + } else { + + if (time() - $_SESSION[self::SESSION_SET] >= $this->sessionExpiration) { + $_SESSION[self::SESSION_NAME] = $this->generateToken(); + $_SESSION[self::SESSION_SET] = time(); + } + + } + + return $_SESSION[self::SESSION_NAME]; + } + + /** + * + * @return string + * @throws MailjetException + */ + private function generateToken() + { + $params = array( + 'method' => 'JSON', + 'AllowedAccess' => $this->tokenAccess, + 'IsActive' => 'true', + 'TokenType' => 'iframe', + 'APIKeyALT' => $this->mailjetApi->getAPIKey(), + 'ValidFor' => $this->sessionExpiration, + ); + + // get the response + $response = $this->mailjetApi->apitoken($params)->getResponse(); + + if (!$response) { + throw new MailjetException( + "The Mailjet API does not respond." + ); + } + + if ($response->Count <= 0) { + throw new MailjetException( + "The Mailjet API object not found." + ); + } + + if (!isset($response->Data[0]->Token)) { + throw new MailjetException( + "The Mailjet API returned invalid response." + ); + } + + return $response->Data[0]->Token; + } + + /** + * + * @return string + */ + private function getIframeUrl() + { + $url = $this->url . $this->initialPage . '?t=' . $this->getToken(); + + $url .= '&locale=' . $this->locale; + + if ($this->callback !== '') { + $url .= '&cb=' . $this->callback; + } + + if ($this->documentationProperties === self::OFF) { + $url .= '&d=hide'; + } + + if ($this->newContactListCreation === self::OFF) { + $url .= '&l=yes'; + } + + if ($this->menu === self::OFF) { + $url .= '&show_menu=none'; + } + + if ($this->showBar === self::ON) { + $url .= '&show_bar=yes'; + } + + if ($this->crc === self::OFF) { + $url .= '&crc=hide'; + } + + if ($this->sp === self::ON) { + $url .= '&sp=display'; + } + + $url .= $this->showFooter === self::OFF ? '&sftr=empty' : ''; + + return $url; + } + + /** + * + * @return null + */ + private function startSession() + { + if (false === $this->isSessionStarted()) { + session_start(); + } + } + + private function isSessionStarted() + { + if ( php_sapi_name() !== 'cli' ) { + if ( version_compare(phpversion(), '5.4.0', '>=') ) { + return session_status() === PHP_SESSION_ACTIVE ? true : false; + } else { + return session_id() === '' ? false : true; + } + } + return false; + } + +} diff --git a/vendor/mailjet/mailjet-apiv3-php/.gitignore b/vendor/mailjet/mailjet-apiv3-php/.gitignore new file mode 100644 index 00000000..39fa433f --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/.gitignore @@ -0,0 +1,13 @@ +tmp/* +[Cc]onfig/core.php +[Cc]onfig/database.php +app/tmp/* +app/[Cc]onfig/core.php +app/[Cc]onfig/database.php +.DS_Store +!empty +composer.phar +vendor/* +composer.lock +/.metadata/ +/.metadata/ diff --git a/vendor/mailjet/mailjet-apiv3-php/.travis.yml b/vendor/mailjet/mailjet-apiv3-php/.travis.yml new file mode 100644 index 00000000..602b289d --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/.travis.yml @@ -0,0 +1,15 @@ +language: php +php: + - 7.0 + - 7.1 + - 5.4 + - 5.5 + - 5.6 +install: + - composer install +script: phpunit --coverage-clover build/logs/clover.xml +after_success: + - travis_retry vendor/bin/coveralls -v +notifications: + slack: + secure: woxqf55Y5XlEOr9WrXalAMQEay8Rqpd9RdvQXw28AZsySVIYP2btfdA7OJRTiC7znIaSXQZqAeIZhKYXCLUv6QqG/saNe9sV5MC9o6sC4FgqdaPU493X2C7KSiwMqeyY9v0bbeUUI9O/g0cnaQGD/NJmVIpvaYz6Tu0MM06fB4c= diff --git a/LICENSE b/vendor/mailjet/mailjet-apiv3-php/LICENSE old mode 100755 new mode 100644 similarity index 100% rename from LICENSE rename to vendor/mailjet/mailjet-apiv3-php/LICENSE diff --git a/vendor/mailjet/mailjet-apiv3-php/README.md b/vendor/mailjet/mailjet-apiv3-php/README.md new file mode 100644 index 00000000..4248c5c6 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/README.md @@ -0,0 +1,268 @@ + +[doc]: http://dev.mailjet.com/guides/?php# +[api_credential]: https://app.mailjet.com/account/api_keys +[mailjet]: http://www.mailjet.com + +![alt text](http://cdn.appstorm.net/web.appstorm.net/files/2012/02/mailjet_logo_200x200.png "Mailjet") + +[![Codacy Badge](https://api.codacy.com/project/badge/grade/3fa729f3750849ce8e0471b0487439cb)](https://www.codacy.com/app/gbadi/mailjet-apiv3-php) +[![Build Status](https://travis-ci.org/mailjet/mailjet-apiv3-php.svg?branch=master)](https://travis-ci.org/mailjet/mailjet-apiv3-php) +![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square) +![Current Version](https://img.shields.io/badge/version-1.1.8-green.svg) + +[Mailjet][mailjet] API Client. + +Check out all the resources and all the PHP code examples on the official documentation: [Mailjet Documentation][doc] + +## Requirements + +`PHP >= 5.4` + +## Installation + +``` bash +composer require mailjet/mailjet-apiv3-php +``` +Without composer: + +Clone or download [this repository](https://github.com/mailjet/mailjet-apiv3-php-no-composer) that already contains all the dependencies and the `vendor/autoload.php` file. If you encounter an issue, please post it here and not on the mirror repository. + +## Getting Started! + +[Grab][api_credential] and save your Mailjet API credentials. +It will create some variables available in your code, via the `getenv` function: + +``` bash + +export MJ_APIKEY_PUBLIC='your api key' +export MJ_APIKEY_PRIVATE='your api secret' + +``` + +Initialize your [Mailjet][mailjet] Client: + +``` php + +``` +It's as easy as 1, 2, 3! + + +## Make your first call + +``` php +get(Resources::$Contact); + +/* + Read the response +*/ +if ($response->success()) + var_dump($response->getData()); +else + var_dump($response->getStatus()); + +``` + +### [Filtering resources](http://dev.mailjet.com/guides/?php#filtering-resources) + +The [Mailjet][mailjet] API provides a set of general filters that can be applied to a GET request for each resource. In addition to these general filters, each API resource has its own filters that can be used when performing the GET: + +``` php + '150']; + +$response = $mj->get(Resources::$Contact, ['filters' => $filters]); + +``` + +### [Send transactional emails](http://dev.mailjet.com/guides/?php#send-transactional-email) + +You can send transactional messages with Mailjet's v3.1 Send API with the following code: + +``` php + 'v3.1']); +$body = [ + 'Messages' => [ + [ + 'From' => [ + 'Email' => "pilot@mailjet.com", + 'Name' => "Mailjet Pilot" + ], + 'To' => [ + [ + 'Email' => "passenger1@mailjet.com", + 'Name' => "passenger 1" + ] + ], + 'Subject' => "Your email flight plan!", + 'TextPart' => "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!", + 'HTMLPart' => "

    Dear passenger 1, welcome to Mailjet!


    May the delivery force be with you!" + ] + ] +]; +$response = $mj->post(Resources::$Email, ['body' => $body]); +$response->success() && var_dump($response->getData()); +?> +``` + +In case you wish to use Mailjet's Send API v3, you can find the legacy documentation and code samples [here](https://dev.mailjet.com/legacy/?php#send-api-v3-august-2017). + + +### [Send marketing campaign](http://dev.mailjet.com/guides/?php#send-marketing-campaigns) + +In order to send your first newsletter, you need to have at least one active sender address in the Sender domains & addresses section. + +``` php + [ + [ + 'Email' => "mailjet@example.org", + 'Name' => "Mailjet" + ] + ] +]; + +$response = $mj->post(Resources::$NewsletterTest, ['id' => $id, 'body' => $body]); + +?> +``` + +### [Event API - real time notifications](http://dev.mailjet.com/guides/?php#event-api-real-time-notifications) + +The [Event API](https://www.mailjet.com/feature/event-api/) offers a real-time notification through http request on any events related to the messages you sent. The main supported events are open, click, bounce, spam, blocked, unsub and sent. This event notification works for transactional and marketing emails. + +The endpoint is a URL our server will call for each event (it can lead to a lot of hits). You can use the API to setup a new endpoint using the /eventcallbackurl resource. Alternatively, you can configure this in your account preferences, in the Event Tracking section. + +``` php + "open", + 'Url' => "https://mydomain.com/event_handler" +]; + +$response = $mj->post(Resources::$Eventcallbackurl, ['body' => $body]); +``` + +### [Statistics](http://dev.mailjet.com/guides/?php#statistics) + +The [Mailjet][mailjet] API offers resources to extract information for every message you send. You can also filter through the message statistics to view specific metrics for your messages. + +``` php +get(Resources::$Message, ['id' => $id]); +``` + +### [Parse API - Inbound emails](http://dev.mailjet.com/guides/?php#parse-api-inbound-emails) + +The Parse API allows you to have inbound emails parsed and their content delivered to a webhook of your choice. +In order to begin receiving emails to your webhook, create a new instance of the Parse API via a POST request on the /parseroute resource. + +``` php + 'https://www.mydomain.com/mj_parse.php' +]; + +$response = $mj->post(Resources::$Parseroute, ['body' => $body]); + +``` + +## Version 1.2.0 of the PHP wrapper + +This version modifies the way to construct the Client or the calls. We add the possibility to add an array with parameters on both Client creation and API call (please note that each of these parameters are preset and are not mandatory in the creation or the call): + +Properties of the $settings (Client constructor) and $options (API call function) + + - url (Default: api.mailjet.com): domain name of the API + - version (Default: v3): API version (only working for Mailjet API V3+) + - call (Default: true): turns on(true) / off the call to the API + - secured (Default: true): turns on(true) / off the use of 'https' + +### A basic example: + +``` php + "www.mailjet.com", 'version' => 'v3', 'call' => false] + ); + +// API call with specific options. The options passed in the call will only be used for this call. +$response = $mj->get(Resources::$Contact, [], ['version' => 'v3']); + +``` + +Priority list of options, settings, and default configurations in order of precedence: + +API call > Client constructor > Resource (only with version, available in the Resources Class - [Resources.php](src/Mailjet/Resources.php)) > Wrapper configuration ([Config.php](src/Mailjet/Config.php)) + +## Version 1.4.0 of the PHP wrapper + +This version adds the possibility to use authentication with bearer token and use the [SMS features](https://dev.mailjet.com/guides-sms/#overview) of the API. The bearer token can be generated in the [SMS menu](https://app.mailjet.com/sms) of your Mailjet account. + +To create a new instance of the Mailjet client with token auth the token should be provided as the first parameter, the second must be NULL: +``` php +$mj = new \Mailjet\Client(getenv('MJ_APITOKEN'), + NULL, true, + ['url' => "www.mailjet.com", 'version' => 'v3', 'call' => false] + ); +``` + +An example SMS API request. The available SMS resources can be seen [here](src/Mailjet/Resources.php#L106). +``` php +$mj = new \Mailjet\Client($token); +$response = $mj->get(Resources::$Sms); +if ($response->success()) { + var_dump($response->getData()); +} else { + var_dump($response->getStatus()); +} +``` + +## Send a pull request + + - Fork the project. + - Create a topic branch. + - Implement your feature/bug fix. + - Add documentation for your feature or bug fix. + - Add specs for your feature or bug fix. + - Commit and push your changes. + - Submit a pull request. Please do not include changes to the gemspec, or version file. diff --git a/vendor/mailjet/mailjet-apiv3-php/composer.json b/vendor/mailjet/mailjet-apiv3-php/composer.json new file mode 100644 index 00000000..ad9d527e --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/composer.json @@ -0,0 +1,27 @@ +{ + "name": "mailjet/mailjet-apiv3-php", + "description": "PHP wrapper for the Mailjet API", + "keywords": ["mailjet", "api", "v3", "php", "email"], + "homepage": "https://github.com/mailjet/mailjet-apiv3-php/", + "license": "MIT", + "authors": [ + { + "name": "Mailjet", + "email": "dev@mailjet.com", + "homepage": "https://dev.mailjet.com" + } + ], + "require": { + "php": ">=5.4.0", + "guzzlehttp/guzzle": "~6.0|~5.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "php-coveralls/php-coveralls": "^1.0" + }, + "autoload": { + "psr-0": { + "Mailjet": "src/" + } + } +} diff --git a/vendor/mailjet/mailjet-apiv3-php/phpunit.xml.dist b/vendor/mailjet/mailjet-apiv3-php/phpunit.xml.dist new file mode 100644 index 00000000..c04f516e --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/phpunit.xml.dist @@ -0,0 +1,19 @@ + + + + + + + ./test/Mailjet/MailjetApiv3Test.php + + + + + src/ + + + diff --git a/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Client.php b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Client.php new file mode 100644 index 00000000..c8cd1e77 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Client.php @@ -0,0 +1,400 @@ + + * @license MIT https://opensource.org/licenses/MIT + * @link dev.mailjet.com + */ + +namespace Mailjet; + +class Client +{ + + const WRAPPER_VERSION = Config::WRAPPER_VERSION; + + /** + * connect_timeout: (float, default=2) Float describing the number of + * seconds to wait while trying to connect to a server. Use 0 to wait + * indefinitely (the default behavior). + */ + const CONNECT_TIMEOUT = 'connect_timeout'; + + /** + * timeout: (float, default=15) Float describing the timeout of the + * request in seconds. Use 0 to wait indefinitely (the default behavior). + */ + const TIMEOUT = 'timeout'; + + private $apikey; + private $apisecret; + private $apitoken; + private $version = Config::MAIN_VERSION; + private $url = Config::MAIN_URL; + private $secure = Config::SECURED; + private $call = true; + private $settings = []; + private $changed = false; + private $requestOptions = [ + self::TIMEOUT => 15, + self::CONNECT_TIMEOUT => 2, + ]; + private $smsResources = [ + 'send', + 'sms', + 'sms-send' + ]; + private $dataAction = [ + 'csverror/text:csv', + 'csvdata/text:plain', + 'JSONError/application:json/LAST' + ]; + + /** + * Client constructor requires: + * @param string $key Mailjet API Key + * @param string $secret Mailjet API Secret + * @param boolean $call performs the call or not + */ + public function __construct($key, $secret = false, $call = true, array $settings = []) + { + $this->setAuthentication($key, $secret, $call, $settings); + } + + /** + * Set auth + * @param string $key + * @param string|null $secret + * @param bool $call + * @param array $settings + */ + private function setAuthentication($key, $secret, $call, $settings) + { + $isBasicAuth = $this->isBasicAuthentication($key, $secret); + if ($isBasicAuth) { + $this->apikey = $key; + $this->apisecret = $secret; + } else { + $this->apitoken = $key; + $this->version = Config::SMS_VERSION; + } + $this->initSettings($call, $settings); + $this->setSettings(); + } + + /** + * Magic method to call a mailjet resource + * @param string $method Http method + * @param string $resource mailjet resource + * @param string $action mailjet resource action + * @param array $args Request arguments + * @return Response server response + */ + private function _call($method, $resource, $action, $args) + { + $args = array_merge( + [ + 'id' => '', + 'actionid' => '', + 'filters' => [], + 'body' => $method == 'GET' ? null : '{}', + ], array_change_key_case($args) + ); + + $url = $this->buildURL($resource, $action, $args['id'], $args['actionid']); + + $contentType = ($action == 'csvdata/text:plain' || $action == 'csverror/text:csv') ? 'text/plain' : 'application/json'; + + $isBasicAuth = $this->isBasicAuthentication($this->apikey, $this->apisecret); + $auth = $isBasicAuth ? [$this->apikey, $this->apisecret] : [$this->apitoken]; + + $request = new Request( + $auth, $method, $url, $args['filters'], $args['body'], $contentType, $this->requestOptions + ); + return $request->call($this->call); + } + + /** + * Build the base API url depending on wether user need a secure connection + * or not + * @return string the API url; + */ + private function getApiUrl() + { + $h = $this->secure === true ? 'https' : 'http'; + return sprintf('%s://%s/%s/', $h, $this->url, $this->version); + } + + /** + * Checks that both parameters are strings, which means + * that basic authentication will be required + * + * @param string $key + * @param string $secret + * + * @return boolean flag + */ + private function isBasicAuthentication($key, $secret) + { + if (!empty($key) && !empty($secret)) { + return true; + } + return false; + } + + /** + * Trigger a POST request + * @param array $resource Mailjet Resource/Action pair + * @param array $args Request arguments + * @return Response + */ + public function post($resource, array $args = [], array $options = []) + { + if (!empty($options)) { + $this->setOptions($options, $resource); + } + $result = $this->_call('POST', $resource[0], $resource[1], $args); + + if (!empty($this->changed)) { + $this->setSettings(); + } + return $result; + } + + /** + * Trigger a GET request + * @param array $resource Mailjet Resource/Action pair + * @param array $args Request arguments + * @return Response + */ + public function get($resource, array $args = [], array $options = []) + { + if (!empty($options)) { + $this->setOptions($options, $resource); + } + $result = $this->_call('GET', $resource[0], $resource[1], $args); + if (!empty($this->changed)) { + $this->setSettings(); + } + return $result; + } + + /** + * Trigger a POST request + * @param array $resource Mailjet Resource/Action pair + * @param array $args Request arguments + * @return Response + */ + public function put($resource, array $args = [], array $options = []) + { + if (!empty($options)) { + $this->setOptions($options, $resource); + } + $result = $this->_call('PUT', $resource[0], $resource[1], $args); + if (!empty($this->changed)) { + $this->setSettings(); + } + return $result; + } + + /** + * Trigger a GET request + * @param array $resource Mailjet Resource/Action pair + * @param array $args Request arguments + * @return Response + */ + public function delete($resource, array $args = [], array $options = []) + { + if (!empty($options)) { + $this->setOptions($options, $resource); + } + $result = $this->_call('DELETE', $resource[0], $resource[1], $args); + if (!empty($this->changed)) { + $this->setSettings(); + } + return $result; + } + + /** + * Build the final call url without query strings + * @param string $resource Mailjet resource + * @param string $action Mailjet resource action + * @param string $id mailjet resource id + * @param string $actionid mailjet resource actionid + * @return string final call url + */ + private function buildURL($resource, $action, $id, $actionid) + { + $path = 'REST'; + if (in_array($resource, $this->smsResources)) { + $path = ''; + } elseif (in_array($action, $this->dataAction)) { + $path = 'DATA'; + } + + $arrayFilter = [$path, $resource, $id, $action, $actionid]; + return $this->getApiUrl() . join('/', array_filter($arrayFilter)); + } + + /** + * Sets if we need to use https or http protocol while using API Url + * @param bool $bIsSecured True use https / false use http + * @return bool true if we set value false otherwise + */ + public function setSecureProtocol($bIsSecured) + { + if (is_bool($bIsSecured)) { + $this->secure = $bIsSecured; + + return true; + } + + return false; + } + + // TODO : make the next code more readable + + /** + * Temporary set the variables generating the url + * @param array $options contain temporary modifications for the client + * @param array $resource may contain the version linked to the ressource + */ + private function setOptions($options, $resource) + { + if (!empty($options['version']) && is_string($options['version'])) { + $this->version = $options['version']; + } elseif (!empty($resource[2])) { + $this->version = $resource[2]; + } + + if (!empty($options['url']) && is_string($options['url'])) { + $this->url = $options['url']; + } + + if (isset($options['secured']) && is_bool($options['secured'])) { + $this->secure = $options['secured']; + } + + if (isset($options['call']) && is_bool($options['call'])) { + $this->call = $options['call']; + } + $this->changed = true; + } + + /** + * set back the variables generating the url + */ + private function setSettings() + { + if (!empty($this->settings['url']) && is_string($this->settings['url'])) { + $this->url = $this->settings['url']; + } if (!empty($this->settings['version']) && is_string($this->settings['version'])) { + $this->version = $this->settings['version']; + } if (isset($this->settings['call']) && is_bool($this->settings['call'])) { + $this->call = $this->settings['call']; + } if (isset($this->settings['secured']) && is_bool($this->settings['secured'])) { + $this->secure = $this->settings['secured']; + } + $this->changed = false; + } + + /** + * Set a backup if the variables generating the url are change during a call. + */ + private function initSettings($call, $settings = []) + { + if (!empty($settings['url']) && is_string($settings['url'])) { + $this->settings['url'] = $settings['url']; + } else { + $this->settings['url'] = $this->url; + } + + if (!empty($settings['version']) && is_string($settings['version'])) { + $this->settings['version'] = $settings['version']; + } else { + $this->settings['version'] = $this->version; + } + + $settings['call'] = $call; + if (isset($settings['call']) && is_bool($settings['call'])) { + $this->settings['call'] = $settings['call']; + } else { + $this->settings['call'] = $this->call; + } + + if (isset($settings['secured']) && is_bool($settings['secured'])) { + $this->settings['secured'] = $settings['secured']; + } else { + $this->settings['secured'] = $this->secure; + } + + $this->changed = false; + } + + /** + * Set HTTP request Timeout + * @param $timeout + */ + public function setTimeout($timeout) + { + $this->requestOptions[self::TIMEOUT] = $timeout; + } + + /** + * Set HTTP connection Timeout + * @param $timeout + */ + public function setConnectionTimeout($timeout) + { + $this->requestOptions[self::CONNECT_TIMEOUT] = $timeout; + } + + /** + * Get HTTP request Timeout + * $return $timeout + */ + public function getTimeout() + { + return $this->requestOptions[self::TIMEOUT]; + } + + /** + * Get HTTP connection Timeout + * $return $timeout + */ + public function getConnectionTimeout() + { + return $this->requestOptions[self::CONNECT_TIMEOUT]; + } + + /** + * Add a HTTP request option + * @param array $key + * @param array $value + * [IMPORTANT]Default options will be overwritten + * if such option is provided + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function addRequestOption($key, $value) + { + if ((!is_null($key)) && (!is_null($value))) { + $this->requestOptions[$key] = $value; + } + } + + /** + * Get HTTP connection options + * $return array requestOptions + */ + public function getRequestOptions() + { + return $this->requestOptions; + } + +} diff --git a/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Config.php b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Config.php new file mode 100644 index 00000000..511d9aa2 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Config.php @@ -0,0 +1,25 @@ + + * @license MIT https://opensource.org/licenses/MIT + * @link dev.mailjet.com + */ + +namespace Mailjet; + +class Config +{ + const WRAPPER_VERSION = 'v1.4.1'; + const USER_AGENT = 'mailjet-apiv3-php/'; + const MAIN_VERSION = 'v3'; + const MAIN_URL = "api.mailjet.com"; + const SECURED = true; + const SMS_VERSION = 'v4'; +} diff --git a/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Request.php b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Request.php new file mode 100644 index 00000000..7e316d16 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Request.php @@ -0,0 +1,139 @@ + + * @license MIT https://opensource.org/licenses/MIT + * @link dev.mailjet.com + */ + +namespace Mailjet; + +use GuzzleHttp\Client as GuzzleClient; +use GuzzleHttp\Exception\ClientException; +use GuzzleHttp\Exception\ServerException; + +class Request extends GuzzleClient { + + private $method; + private $url; + private $filters; + private $body; + private $auth; + private $type; + private $requestOptions = []; + + /** + * Build a new Http request + * @param array $auth [apikey, apisecret] + * @param string $method http method + * @param string $url call url + * @param array $filters Mailjet resource filters + * @param array $body Mailjet resource body + * @param string $type Request Content-type + */ + public function __construct($auth, $method, $url, $filters, $body, $type, array $requestOptions = []) { + parent::__construct(['defaults' => [ + 'headers' => [ + 'user-agent' => Config::USER_AGENT . phpversion() . '/' . Client::WRAPPER_VERSION + ] + ]]); + $this->type = $type; + $this->auth = $auth; + $this->method = $method; + $this->url = $url; + $this->filters = $filters; + $this->body = $body; + $this->requestOptions = $requestOptions; + } + + /** + * Trigger the actual call + * TODO: DATA API + * @param $call + * @return Response the call response + */ + public function call($call) { + $payload = [ + 'query' => $this->filters, + ($this->type === 'application/json' ? 'json' : 'body') => $this->body, + ]; + + $authArgsCount = count($this->auth); + $headers = [ + 'content-type' => $this->type + ]; + + if ($authArgsCount > 1) { + $payload['auth'] = $this->auth; + } else { + $headers['Authorization'] = 'Bearer ' . $this->auth[0]; + } + + $payload['headers'] = $headers; + + if ((! empty($this->requestOptions)) && (is_array($this->requestOptions))) { + $payload = array_merge_recursive($payload, $this->requestOptions); + } + + $response = null; + if ($call) { + try { + $response = call_user_func_array( + [$this, strtolower($this->method)], [$this->url, $payload] + ); + } catch (ClientException $e) { + $response = $e->getResponse(); + } catch (ServerException $e) { + $response = $e->getResponse(); + } + } + return new Response($this, $response); + } + + /** + * Filters getters + * @return array Request filters + */ + public function getFilters() { + return $this->filters; + } + + /** + * Http method getter + * @return string Request method + */ + public function getMethod() { + return $this->method; + } + + /** + * Call Url getter + * @return string Request Url + */ + public function getUrl() { + return $this->url; + } + + /** + * Request body getter + * @return array request body + */ + public function getBody() { + return $this->body; + } + + /** + * Auth getter. to discuss + * @return string Request auth + */ + public function getAuth() { + return $this->auth; + } + +} diff --git a/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Resources.php b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Resources.php new file mode 100644 index 00000000..d5a81252 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Resources.php @@ -0,0 +1,110 @@ + + * @license MIT https://opensource.org/licenses/MIT + * @link dev.mailjet.com + */ +class Resources +{ + public static $Email = ['send', ''/*, 'v3.1'*/]; + public static $Aggregategraphstatistics = ['aggregategraphstatistics', '']; + public static $Apikey = ['apikey', '']; + public static $Apikeyaccess = ['apikeyaccess', '']; + public static $Apikeytotals = ['apikeytotals', '']; + public static $Apitoken = ['apitoken', '']; + public static $Axtesting = ['axtesting', '']; + public static $Batchjob = ['batchjob', '']; + public static $BatchjobCsverror = ['batchjob', 'csverror/text:csv']; + public static $BatchjobJsonerror = ['batchjob', 'JSONError/application:json/LAST']; + public static $Bouncestatistics = ['bouncestatistics', '']; + public static $Campaign = ['campaign', '']; + public static $Campaignaggregate = ['campaignaggregate', '']; + public static $Campaigndraft = ['campaigndraft', '']; + public static $CampaigndraftSchedule = ['campaigndraft', 'schedule']; + public static $CampaigndraftStatus = ['campaigndraft', 'status']; + public static $CampaigndraftSend = ['campaigndraft', 'send']; + public static $CampaigndraftTest = ['campaigndraft', 'test']; + public static $CampaigndraftDetailcontent = ['campaigndraft', 'detailcontent']; + public static $Campaigngraphstatistics = ['campaigngraphstatistics', '']; + public static $Campaignoverview = ['campaignoverview', '']; + public static $Campaignstatistics = ['campaignstatistics', '']; + public static $Clickstatistics = ['clickstatistics', '']; + public static $Contact = ['contact', '']; + public static $ContactManagecontactslists = ['contact', 'managecontactslists']; + public static $ContactGetcontactslists = ['contact', 'getcontactslists']; + public static $ContactManagemanycontacts = ['contact', 'managemanycontacts']; + public static $Contactdata = ['contactdata', '']; + public static $Contactfilter = ['contactfilter', '']; + public static $Contacthistorydata = ['contacthistorydata', '']; + public static $Contactmetadata = ['contactmetadata', '']; + public static $Contactslist = ['contactslist', '']; + public static $ContactslistCsvdata = ['contactslist', 'csvdata/text:plain']; + public static $ContactslistManagecontact = ['contactslist', 'ManageContact']; + public static $ContactslistManagemanycontacts = ['contactslist', 'ManageManyContacts']; + public static $ContactslistImportlist = ['contactslist', 'ImportList']; + public static $Contactslistsignup = ['contactslistsignup', '']; + public static $Contactstatistics = ['contactstatistics', '']; + public static $Csvimport = ['csvimport', '']; + public static $Dns = ['dns', '']; + public static $DnsCheck = ['dns', 'check']; + public static $Domainstatistics = ['domainstatistics', '']; + public static $Eventcallbackurl = ['eventcallbackurl', '']; + public static $Geostatistics = ['geostatistics', '']; + public static $Graphstatistics = ['graphstatistics', '']; + public static $Listrecipient = ['listrecipient', '']; + public static $Listrecipientstatistics = ['listrecipientstatistics', '']; + public static $Liststatistics = ['liststatistics', '']; + public static $Message = ['message', '']; + public static $Messagehistory = ['messagehistory', '']; + public static $Messageinformation = ['messageinformation', '']; + public static $Messagesentstatistics = ['messagesentstatistics', '']; + public static $Messagestate = ['messagestate', '']; + public static $Messagestatistics = ['messagestatistics', '']; + public static $Metadata = ['metadata', '']; + public static $Metasender = ['metasender', '']; + public static $Myprofile = ['myprofile', '']; + public static $Newsletter = ['newsletter', '']; + public static $NewsletterSchedule = ['newsletter', 'schedule']; + public static $NewsletterStatus = ['newsletter', 'status']; + public static $NewsletterSend = ['newsletter', 'send']; + public static $NewsletterTest = ['newsletter', 'test']; + public static $NewsletterDetailcontent = ['newsletter', 'detailcontent']; + public static $Newslettertemplate = ['newslettertemplate', '']; + public static $Newslettertemplatecategory = ['newslettertemplatecategory', '']; + public static $Openinformation = ['openinformation', '']; + public static $Openstatistics = ['openstatistics', '']; + public static $Parseroute = ['parseroute', '']; + public static $Preferences = ['preferences', '']; + public static $Preset = ['preset', '']; + public static $Sender = ['sender', '']; + public static $SenderValidate = ['sender', 'validate']; + public static $Senderstatistics = ['senderstatistics', '']; + public static $Template = ['template', '']; + public static $TemplateDetailcontent = ['template', 'detailcontent']; + public static $TemplateDetailpreviews = ['template', 'detailpreviews']; + public static $TemplateDisplaypreview = ['template', 'displaypreview']; + public static $TemplateDetailthumbnail = ['template', 'detailthumbnail']; + public static $TemplateDisplaythumbnail = ['template', 'displaythumbnail']; + public static $Toplinkclicked = ['toplinkclicked', '']; + public static $Trigger = ['trigger', '']; + public static $User = ['user', '']; + public static $UserActivate = ['user', 'activate']; + public static $Useragentstatistics = ['useragentstatistics', '']; + public static $Widget = ['widget', '']; + public static $Widgetcustomvalue = ['widgetcustomvalue', '']; + public static $Statcounters = ['statcounters', '']; + public static $StatisticsLinkclick = ['statistics', 'link-click']; + public static $StatisticsRecipientesp = ['statistics', 'recipient-esp']; + public static $Sms = ['sms', '']; + public static $SmsSend = ['sms-send', '']; + public static $SmsExport = ['sms', 'export']; + public static $SmsCount = ['sms', 'count']; +} diff --git a/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Response.php b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Response.php new file mode 100644 index 00000000..d46201d6 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/src/Mailjet/Response.php @@ -0,0 +1,150 @@ + + * @license https://opensource.org/licenses/MIT + * @link dev.mailjet.com + */ + +namespace Mailjet; +use Psr\Http\Message\ResponseInterface; + +class Response +{ + private $status; + private $success; + private $body; + private $rawResponse; + + /** + * Construct a Mailjet response + * @param Request $request Mailjet actual request + * @param ResponseInterface $response Guzzle response + */ + public function __construct($request, $response) + { + $this->request = $request; + + if ($response) { + $this->rawResponse = $response; + $this->status = $response->getStatusCode(); + $this->body = $this->decodeBody($response->getBody()); + $this->success = floor($this->status / 100) == 2 ? true : false; + } + } + + /** + * Status Getter + * return the http status code + * @return int status + */ + public function getStatus() + { + return $this->status; + } + + /** + * Status Getter + * return the entire response array + * @return array + */ + public function getBody() + { + return $this->body; + } + + /** + * Data Getter + * The data returned by the mailjet call + * @return array data + */ + public function getData() + { + if (isset($this->body['Data'])) { + return $this->body['Data']; + } + + return $this->body; + } + + /** + * Count getter + * return the resulting array size + * @return null|int + */ + public function getCount() + { + if (isset($this->body['Count'])) { + return $this->body['Count']; + } + + return null; + } + + /** + * Error Reason getter + * return the resulting error message + * @return null|string + */ + public function getReasonPhrase() + { + return $this->rawResponse->getReasonPhrase(); + } + + /** + * Total getter + * return the total count of all results + * @return int count + */ + public function getTotal() + { + if (isset($this->body['Total'])) { + return $this->body['Total']; + } + + return null; + } + + /** + * Success getter + * @return boolean true is return code is 2** + */ + public function success() + { + return $this->success; + } + + /** + * From http://stackoverflow.com/questions/19520487/json-bigint-as-string-removed-in-php-5-5 + * + * Decodes a mailjet string response to an object reprensenting that response + * + * @param string $body The mailjet response as string + * + * @return object Object representing the mailjet response + */ + protected function decodeBody($body) + { + if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) { + /** In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you + * to specify that large ints (like Steam Transaction IDs) should be treated as + * strings, rather than the PHP default behaviour of converting them to floats. + */ + $object = json_decode($body, true, 512, JSON_BIGINT_AS_STRING); + } else { + /** Not all servers will support that, however, so for older versions we must + * manually detect large ints in the JSON string and quote them (thus converting + *them to strings) before decoding, hence the preg_replace() call. + */ + $maxIntLength = strlen((string) PHP_INT_MAX) - 1; + $jsonWithoutBigIntegers = preg_replace('/:\s*(-?\d{'.$maxIntLength.',})/', ': "$1"', $body); + $object = json_decode($jsonWithoutBigIntegers, true); + } + return $object; + } +} diff --git a/vendor/mailjet/mailjet-apiv3-php/test/Mailjet/MailjetApiv3Test.php b/vendor/mailjet/mailjet-apiv3-php/test/Mailjet/MailjetApiv3Test.php new file mode 100644 index 00000000..2a29d5e0 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/test/Mailjet/MailjetApiv3Test.php @@ -0,0 +1,201 @@ +assertEquals(self::API_BASE_URL . $version . $url, $response->request->getUrl()); + } + + private function assertPayload($payload, $response) + { + $this->assertEquals($payload, $response->request->getBody()); + } + + private function assertFilters($shouldBe, $response) + { + $this->assertEquals($shouldBe, $response->request->getFilters()); + } + + private function assertHttpMethod($payload, $response) + { + $this->assertEquals($payload, $response->request->getMethod()); + } + + private function assertGetAuth($response) + { + $this->assertEquals($this->publicKey, $response->request->getAuth()[0]); + $this->assertEquals($this->secretKey, $response->request->getAuth()[1]); + } + + private function assertGetStatus($payload, $response) + { + $this->assertEquals($payload, $response->getStatus()); + } + + private function assertGetBody($payload, $keyName, $response) + { + $this->assertEquals($payload, $response->getBody()[$keyName]); + } + + private function assertGetData($payload, $keyName, $response) + { + $this->assertEquals($payload, $response->getData()[$keyName]); + } + + private function assertGetCount($payload, $response) + { + $this->assertEquals($payload, $response->getCount()); + } + + private function assertGetReasonPhrase($payload, $response) + { + $this->assertEquals($payload, $response->getReasonPhrase()); + } + + private function assertGetTotal($payload, $response) + { + $this->assertEquals($payload, $response->getTotal()); + } + + private function assertSuccess($payload, $response) + { + $this->assertEquals($payload, $response->success()); + } + + private function assertSetSecureProtocol($client) + { + $this->assertTrue($client->setSecureProtocol(true)); + $this->assertFalse($client->setSecureProtocol('not boolean type')); + } + + public function testGet() + { + $client = new Client($this->publicKey, $this->secretKey, true); + + $this->assertUrl('/REST/contact', $client->get(Resources::$Contact)); + + $this->assertFilters(['id' => 2], $client->get(Resources::$Contact, [ + 'filters' => ['id' => 2] + ], ['version' => 'v3.1'])); + + $response = $client->get(Resources::$ContactGetcontactslists, ['id' => 2]); + $this->assertUrl('/REST/contact/2/getcontactslists', $response); + + // error on sort ! + $response = $client->get(Resources::$Contact, [ + 'filters' => ['sort' => 'email+DESC'] + ]); + + $this->assertUrl('/REST/contact', $response); + + $this->assertUrl('/REST/contact/2', $client->get(Resources::$Contact, ['id' => 2])); + + $this->assertUrl( + '/REST/contact/test@mailjet.com', $client->get(Resources::$Contact, ['id' => 'test@mailjet.com']) + ); + + $this->assertHttpMethod('GET', $response); + + $this->assertGetAuth($response); + + $this->assertGetStatus(401, $response); + + $this->assertGetBody('', '', $response); + + $this->assertGetData('', '', $response); + + $this->assertGetCount('', $response); + + $this->assertGetReasonPhrase('Unauthorized', $response); + + $this->assertGetTotal('', $response); + + $this->assertSuccess('', $response); + + $this->assertSetSecureProtocol($client); + } + + public function testPost() + { + $client = new Client($this->publicKey, $this->secretKey, true); + + $email = [ + 'FromName' => 'Mailjet PHP test', + 'FromEmail' => 'gbadi@student.42.fr', + 'Text-Part' => 'Simple Email test', + 'Subject' => 'PHPunit', + 'Html-Part' => '

    Simple Email Test

    ', + 'Recipients' => [['Email' => 'test@mailjet.com']], + 'MJ-custom-ID' => 'Hello ID', + ]; + + $ret = $client->post(Resources::$Email, ['body' => $email]); + $this->assertUrl('/send', $ret); + $this->assertPayload($email, $ret); + $this->assertHttpMethod('POST', $ret); + $this->assertGetAuth($ret); + $this->assertGetStatus(401, $ret); + $this->assertGetBody('', 'StatusCode', $ret); + $this->assertGetData('', 'StatusCode', $ret); + $this->assertGetCount('', $ret); + $this->assertGetReasonPhrase('Unauthorized', $ret); + $this->assertGetTotal('', $ret); + $this->assertSuccess('', $ret); + } + + public function testPostV3_1() + { + $client = new Client($this->publicKey, $this->secretKey, ['call' => false]); + + $email = [ + 'Messages' => [[ + 'From' => ['Email' => "test@mailjet.com", 'Name' => "Mailjet PHP test"], + 'TextPart' => "Simple Email test", + 'To' => [['Email' => "test@mailjet.com", 'Name' => 'Test']] + ]] + ]; + + $ret = $client->post(Resources::$Email, ['body' => $email], ['version' => 'v3.1']); + $this->assertUrl('/send', $ret, 'v3.1'); + $this->assertPayload($email, $ret); + $this->assertHttpMethod('POST', $ret); + $this->assertGetAuth($ret); + $this->assertGetStatus(401, $ret); + $this->assertGetBody(401, 'StatusCode', $ret); + $this->assertGetData(401, 'StatusCode', $ret); + $this->assertGetCount('', $ret); + $this->assertGetReasonPhrase('Unauthorized', $ret); + $this->assertGetTotal('', $ret); + $this->assertSuccess('', $ret); + } + + public function testClientHasOptions() + { + $client = new Client($this->publicKey, $this->secretKey, ['call' => false]); + $client->setTimeout(3); + $client->setConnectionTimeout(5); + $client->addRequestOption('delay', 23); + $this->assertEquals(3, $client->getTimeout()); + $this->assertEquals(5, $client->getConnectionTimeout()); + $this->assertEquals(23, $client->getRequestOptions()['delay']); + } + +} diff --git a/vendor/mailjet/mailjet-apiv3-php/test/Mailjet/test.php b/vendor/mailjet/mailjet-apiv3-php/test/Mailjet/test.php new file mode 100644 index 00000000..e1be2568 --- /dev/null +++ b/vendor/mailjet/mailjet-apiv3-php/test/Mailjet/test.php @@ -0,0 +1,188 @@ +assertEquals('https://api.mailjet.com/'.$version.$url, $response->request->getUrl()); + } + + public function assertPayload($payload, $response) + { + $this->assertEquals($payload, $response->request->getBody()); + } + + public function assertFilters($shouldBe, $response) + { + $this->assertEquals($shouldBe, $response->request->getFilters()); + } + + public function assertHttpMethod($payload, $response) + { + $this->assertEquals($payload, $response->request->getMethod()); + } + + public function assertGetAuth($payload, $response) + { + $this->assertEquals($payload, $response->request->getAuth()[0]); + $this->assertEquals($payload, $response->request->getAuth()[1]); + } + + public function assertGetStatus($payload, $response) + { + $this->assertEquals($payload, $response->getStatus()); + } + + public function assertGetBody($payload, $keyName, $response) + { + $this->assertEquals($payload, $response->getBody()[$keyName]); + } + + public function assertGetData($payload, $keyName, $response) + { + $this->assertEquals($payload, $response->getData()[$keyName]); + } + + public function assertGetCount($payload, $response) + { + $this->assertEquals($payload, $response->getCount()); + } + + public function assertGetReasonPhrase($payload, $response) + { + $this->assertEquals($payload, $response->getReasonPhrase()); + } + + public function assertGetTotal($payload, $response) + { + $this->assertEquals($payload, $response->getTotal()); + } + + public function assertSuccess($payload, $response) + { + $this->assertEquals($payload, $response->success()); + } + + public function assertSetSecureProtocol($client) + { + $this->assertTrue($client->setSecureProtocol(true)); + $this->assertFalse($client->setSecureProtocol('not boolean type')); + } + + public function testGet() + { + $client = new Client('', '', ['call' => false]); + + $this->assertUrl('/REST/contact', $client->get(Resources::$Contact)); + + $this->assertFilters(['id' => 2], $client->get(Resources::$Contact, [ + 'filters' => ['id' => 2] + ], ['version' => 'v3.1'])); + + $response = $client->get(Resources::$ContactGetcontactslists, ['id' => 2]); + $this->assertUrl('/REST/contact/2/getcontactslists', $response); + + // error on sort ! + $response = $client->get(Resources::$Contact, [ + 'filters' => ['sort' => 'email+DESC'] + ]); + $this->assertUrl('/REST/contact', $response); + + $this->assertUrl('/REST/contact/2', $client->get(Resources::$Contact, ['id' => 2])); + + $this->assertUrl( + '/REST/contact/test@mailjet.com', + $client->get(Resources::$Contact, ['id' => 'test@mailjet.com']) + ); + + $this->assertHttpMethod('GET', $response); + + $this->assertGetAuth('', $response); + + $this->assertGetStatus(401, $response); + + $this->assertGetBody('', '', $response); + + $this->assertGetData('', '', $response); + + $this->assertGetCount('', $response); + + $this->assertGetReasonPhrase('Unauthorized', $response); + + $this->assertGetTotal('', $response); + + $this->assertSuccess('', $response); + + $this->assertSetSecureProtocol($client); + } + + public function testPost() + { + $client = new Client('', '', ['call' => false]); + + $email = [ + 'FromName' => 'Mailjet PHP test', + 'FromEmail' => 'gbadi@student.42.fr', + 'Text-Part' => 'Simple Email test', + 'Subject' => 'PHPunit', + 'Html-Part' => '

    Simple Email Test

    ', + 'Recipients' => [['Email' => 'test@mailjet.com']], + 'MJ-custom-ID' => 'Hello ID', + ]; + + $ret = $client->post(Resources::$Email, ['body' => $email]); + $this->assertUrl('/send', $ret); + $this->assertPayload($email, $ret); + $this->assertHttpMethod('POST', $ret); + $this->assertGetAuth('', $ret); + $this->assertGetStatus(401, $ret); + $this->assertGetBody('', 'StatusCode', $ret); + $this->assertGetData('', 'StatusCode', $ret); + $this->assertGetCount('', $ret); + $this->assertGetReasonPhrase('Unauthorized', $ret); + $this->assertGetTotal('', $ret); + $this->assertSuccess('', $ret); + } + + public function testPostV3_1() + { + $client = new Client('', '', ['call' => false]); + + $email = [ + 'Messages' => [[ + 'From' => ['Email' => "test@mailjet.com", 'Name' => "Mailjet PHP test"], + 'TextPart' => "Simple Email test", + 'To' => [['Email' => "test@mailjet.com", 'Name' => 'Test']] + ]] + ]; + + $ret = $client->post(Resources::$Email, ['body' => $email], ['version' => 'v3.1']); + $this->assertUrl('/send', $ret, 'v3.1'); + $this->assertPayload($email, $ret); + $this->assertHttpMethod('POST', $ret); + $this->assertGetAuth('', $ret); + $this->assertGetStatus(401, $ret); + $this->assertGetBody(401, 'StatusCode', $ret); + $this->assertGetData(401, 'StatusCode', $ret); + $this->assertGetCount('', $ret); + $this->assertGetReasonPhrase('Unauthorized', $ret); + $this->assertGetTotal('', $ret); + $this->assertSuccess('', $ret); + } + + public function testClientHasOptions() + { + $client = new Client('', '', ['call' => false]); + $client->setTimeout(3); + $client->setConnectionTimeout(5); + $client->addRequestOption('delay', 23); + $this->assertEquals(3, $client->getTimeout()); + $this->assertEquals(5, $client->getConnectionTimeout()); + $this->assertEquals(23, $client->getRequestOptions()['delay']); + } + +} diff --git a/vendor/psr/http-message/CHANGELOG.md b/vendor/psr/http-message/CHANGELOG.md new file mode 100644 index 00000000..74b1ef92 --- /dev/null +++ b/vendor/psr/http-message/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.1 - 2016-08-06 + +### Added + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Updated all `@return self` annotation references in interfaces to use + `@return static`, which more closelly follows the semantics of the + specification. +- Updated the `MessageInterface::getHeaders()` return annotation to use the + value `string[][]`, indicating the format is a nested array of strings. +- Updated the `@link` annotation for `RequestInterface::withRequestTarget()` + to point to the correct section of RFC 7230. +- Updated the `ServerRequestInterface::withUploadedFiles()` parameter annotation + to add the parameter name (`$uploadedFiles`). +- Updated a `@throws` annotation for the `UploadedFileInterface::moveTo()` + method to correctly reference the method parameter (it was referencing an + incorrect parameter name previously). + +## 1.0.0 - 2016-05-18 + +Initial stable release; reflects accepted PSR-7 specification. diff --git a/vendor/psr/http-message/LICENSE b/vendor/psr/http-message/LICENSE new file mode 100644 index 00000000..c2d8e452 --- /dev/null +++ b/vendor/psr/http-message/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/psr/http-message/README.md b/vendor/psr/http-message/README.md new file mode 100644 index 00000000..28185338 --- /dev/null +++ b/vendor/psr/http-message/README.md @@ -0,0 +1,13 @@ +PSR Http Message +================ + +This repository holds all interfaces/classes/traits related to +[PSR-7](http://www.php-fig.org/psr/psr-7/). + +Note that this is not a HTTP message implementation of its own. It is merely an +interface that describes a HTTP message. See the specification for more details. + +Usage +----- + +We'll certainly need some stuff in here. \ No newline at end of file diff --git a/vendor/psr/http-message/composer.json b/vendor/psr/http-message/composer.json new file mode 100644 index 00000000..b0d2937a --- /dev/null +++ b/vendor/psr/http-message/composer.json @@ -0,0 +1,26 @@ +{ + "name": "psr/http-message", + "description": "Common interface for HTTP messages", + "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], + "homepage": "https://github.com/php-fig/http-message", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php new file mode 100644 index 00000000..dd46e5ec --- /dev/null +++ b/vendor/psr/http-message/src/MessageInterface.php @@ -0,0 +1,187 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(); + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader($name); + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader($name); + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * concatenated together using a comma. If the header does not appear in + * the message, this method MUST return an empty string. + */ + public function getHeaderLine($name); + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader($name, $value); + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader($name, $value); + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader($name); + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(); + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body); +} diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 00000000..a96d4fd6 --- /dev/null +++ b/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,129 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(); + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query); + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(); + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles); + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data); + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(); + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute($name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute($name, $value); + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute($name); +} diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 00000000..f68f3912 --- /dev/null +++ b/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(); + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(); + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(); + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(); + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(); + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(); + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(); + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme($scheme); + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo($user, $password = null); + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost($host); + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort($port); + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath($path); + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery($query); + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment($fragment); + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(); +} diff --git a/vendor/psr/log/.gitignore b/vendor/psr/log/.gitignore new file mode 100644 index 00000000..22d0d82f --- /dev/null +++ b/vendor/psr/log/.gitignore @@ -0,0 +1 @@ +vendor diff --git a/vendor/psr/log/LICENSE b/vendor/psr/log/LICENSE new file mode 100644 index 00000000..474c952b --- /dev/null +++ b/vendor/psr/log/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/psr/log/Psr/Log/AbstractLogger.php b/vendor/psr/log/Psr/Log/AbstractLogger.php new file mode 100644 index 00000000..90e721af --- /dev/null +++ b/vendor/psr/log/Psr/Log/AbstractLogger.php @@ -0,0 +1,128 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } +} diff --git a/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/vendor/psr/log/Psr/Log/InvalidArgumentException.php new file mode 100644 index 00000000..67f852d1 --- /dev/null +++ b/vendor/psr/log/Psr/Log/InvalidArgumentException.php @@ -0,0 +1,7 @@ +logger = $logger; + } +} diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php new file mode 100644 index 00000000..5ea72438 --- /dev/null +++ b/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -0,0 +1,123 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + */ + abstract public function log($level, $message, array $context = array()); +} diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php new file mode 100644 index 00000000..d8cd682c --- /dev/null +++ b/vendor/psr/log/Psr/Log/NullLogger.php @@ -0,0 +1,28 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + */ + public function log($level, $message, array $context = array()) + { + // noop + } +} diff --git a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php new file mode 100644 index 00000000..4b861c3e --- /dev/null +++ b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php @@ -0,0 +1,144 @@ + ". + * + * Example ->error('Foo') would yield "error Foo". + * + * @return string[] + */ + abstract public function getLogs(); + + public function testImplements() + { + $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); + } + + /** + * @dataProvider provideLevelsAndMessages + */ + public function testLogsAtAllLevels($level, $message) + { + $logger = $this->getLogger(); + $logger->{$level}($message, array('user' => 'Bob')); + $logger->log($level, $message, array('user' => 'Bob')); + + $expected = array( + $level.' message of level '.$level.' with context: Bob', + $level.' message of level '.$level.' with context: Bob', + ); + $this->assertEquals($expected, $this->getLogs()); + } + + public function provideLevelsAndMessages() + { + return array( + LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), + LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), + LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), + LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), + LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), + LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), + LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), + LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), + ); + } + + /** + * @expectedException \Psr\Log\InvalidArgumentException + */ + public function testThrowsOnInvalidLevel() + { + $logger = $this->getLogger(); + $logger->log('invalid level', 'Foo'); + } + + public function testContextReplacement() + { + $logger = $this->getLogger(); + $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); + + $expected = array('info {Message {nothing} Bob Bar a}'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testObjectCastToString() + { + if (method_exists($this, 'createPartialMock')) { + $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); + } else { + $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + } + $dummy->expects($this->once()) + ->method('__toString') + ->will($this->returnValue('DUMMY')); + + $this->getLogger()->warning($dummy); + + $expected = array('warning DUMMY'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testContextCanContainAnything() + { + $closed = fopen('php://memory', 'r'); + fclose($closed); + + $context = array( + 'bool' => true, + 'null' => null, + 'string' => 'Foo', + 'int' => 0, + 'float' => 0.5, + 'nested' => array('with object' => new DummyTest), + 'object' => new \DateTime, + 'resource' => fopen('php://memory', 'r'), + 'closed' => $closed, + ); + + $this->getLogger()->warning('Crazy context data', $context); + + $expected = array('warning Crazy context data'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testContextExceptionKeyCanBeExceptionOrOtherValues() + { + $logger = $this->getLogger(); + $logger->warning('Random message', array('exception' => 'oops')); + $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); + + $expected = array( + 'warning Random message', + 'critical Uncaught Exception!' + ); + $this->assertEquals($expected, $this->getLogs()); + } +} + +class DummyTest +{ + public function __toString() + { + } +} diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php new file mode 100644 index 00000000..0cdffe4f --- /dev/null +++ b/vendor/psr/log/Psr/Log/Test/TestLogger.php @@ -0,0 +1,146 @@ + $level, + 'message' => $message, + 'context' => $context, + ]; + + $this->recordsByLevel[$record['level']][] = $record; + $this->records[] = $record; + } + + public function hasRecords($level) + { + return isset($this->recordsByLevel[$level]); + } + + public function hasRecord($record, $level) + { + if (is_string($record)) { + $record = ['message' => $record]; + } + return $this->hasRecordThatPasses(function ($rec) use ($record) { + if ($rec['message'] !== $record['message']) { + return false; + } + if (isset($record['context']) && $rec['context'] !== $record['context']) { + return false; + } + return true; + }, $level); + } + + public function hasRecordThatContains($message, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($message) { + return strpos($rec['message'], $message) !== false; + }, $level); + } + + public function hasRecordThatMatches($regex, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($regex) { + return preg_match($regex, $rec['message']) > 0; + }, $level); + } + + public function hasRecordThatPasses(callable $predicate, $level) + { + if (!isset($this->recordsByLevel[$level])) { + return false; + } + foreach ($this->recordsByLevel[$level] as $i => $rec) { + if (call_user_func($predicate, $rec, $i)) { + return true; + } + } + return false; + } + + public function __call($method, $args) + { + if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { + $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; + $level = strtolower($matches[2]); + if (method_exists($this, $genericMethod)) { + $args[] = $level; + return call_user_func_array([$this, $genericMethod], $args); + } + } + throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); + } + + public function reset() + { + $this->records = []; + } +} diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md new file mode 100644 index 00000000..5571a25e --- /dev/null +++ b/vendor/psr/log/README.md @@ -0,0 +1,52 @@ +PSR Log +======= + +This repository holds all interfaces/classes/traits related to +[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). + +Note that this is not a logger of its own. It is merely an interface that +describes a logger. See the specification for more details. + +Installation +------------ + +```bash +composer require psr/log +``` + +Usage +----- + +If you need a logger, you can use the interface like this: + +```php +logger = $logger; + } + + public function doSomething() + { + if ($this->logger) { + $this->logger->info('Doing work'); + } + + // do something useful + } +} +``` + +You can then pick one of the implementations of the interface to get a logger. + +If you want to implement the interface, you can require this package and +implement `Psr\Log\LoggerInterface` in your code. Please read the +[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) +for details. diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json new file mode 100644 index 00000000..3f6d4eea --- /dev/null +++ b/vendor/psr/log/composer.json @@ -0,0 +1,26 @@ +{ + "name": "psr/log", + "description": "Common interface for logging libraries", + "keywords": ["psr", "psr-3", "log"], + "homepage": "https://github.com/php-fig/log", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + } +} diff --git a/vendor/ralouphie/getallheaders/.gitignore b/vendor/ralouphie/getallheaders/.gitignore new file mode 100644 index 00000000..1324e7d3 --- /dev/null +++ b/vendor/ralouphie/getallheaders/.gitignore @@ -0,0 +1,5 @@ +.idea +.DS_store +/vendor/ +composer.phar +composer.lock diff --git a/vendor/ralouphie/getallheaders/.travis.yml b/vendor/ralouphie/getallheaders/.travis.yml new file mode 100644 index 00000000..f45b55fa --- /dev/null +++ b/vendor/ralouphie/getallheaders/.travis.yml @@ -0,0 +1,18 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - 7.0 + +before_script: + - composer install + +script: + - mkdir -p build/logs + - php vendor/bin/phpunit -c phpunit.xml + +after_script: + - php vendor/bin/coveralls -v \ No newline at end of file diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 00000000..be5540c2 --- /dev/null +++ b/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 00000000..f3329d66 --- /dev/null +++ b/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,19 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +``` +composer require ralouphie/getallheaders +``` diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 00000000..5a0d595c --- /dev/null +++ b/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,21 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "autoload": { + "files": ["src/getallheaders.php"] + } +} \ No newline at end of file diff --git a/vendor/ralouphie/getallheaders/phpunit.xml b/vendor/ralouphie/getallheaders/phpunit.xml new file mode 100644 index 00000000..7255b23d --- /dev/null +++ b/vendor/ralouphie/getallheaders/phpunit.xml @@ -0,0 +1,22 @@ + + + + ./tests + + + + + src + + + + + + + + \ No newline at end of file diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 00000000..c7285a5b --- /dev/null +++ b/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php b/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php new file mode 100644 index 00000000..8e3d1790 --- /dev/null +++ b/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php @@ -0,0 +1,121 @@ + $val) { + $_SERVER[$key] = $val; + } + $result = getallheaders(); + $this->assertEquals($expected, $result, "Error testing $test_type works."); + } + + public function testWorksData() + { + return array( + array( + 'normal case', + array( + 'Key-One' => 'foo', + 'Key-Two' => 'bar', + 'Another-Key-For-Testing' => 'baz' + ), + array( + 'HTTP_KEY_ONE' => 'foo', + 'HTTP_KEY_TWO' => 'bar', + 'HTTP_ANOTHER_KEY_FOR_TESTING' => 'baz' + ) + ), + array( + 'Content-Type', + array( + 'Content-Type' => 'two' + ), + array( + 'HTTP_CONTENT_TYPE' => 'one', + 'CONTENT_TYPE' => 'two' + ) + ), + array( + 'Content-Length', + array( + 'Content-Length' => '222' + ), + array( + 'CONTENT_LENGTH' => '222', + 'HTTP_CONTENT_LENGTH' => '111' + ) + ), + array( + 'Content-Length (HTTP_CONTENT_LENGTH only)', + array( + 'Content-Length' => '111' + ), + array( + 'HTTP_CONTENT_LENGTH' => '111' + ) + ), + array( + 'Content-MD5', + array( + 'Content-Md5' => 'aef123' + ), + array( + 'CONTENT_MD5' => 'aef123', + 'HTTP_CONTENT_MD5' => 'fea321' + ) + ), + array( + 'Content-MD5 (HTTP_CONTENT_MD5 only)', + array( + 'Content-Md5' => 'f123' + ), + array( + 'HTTP_CONTENT_MD5' => 'f123' + ) + ), + array( + 'Authorization (normal)', + array( + 'Authorization' => 'testing' + ), + array( + 'HTTP_AUTHORIZATION' => 'testing', + ) + ), + array( + 'Authorization (redirect)', + array( + 'Authorization' => 'testing redirect' + ), + array( + 'REDIRECT_HTTP_AUTHORIZATION' => 'testing redirect', + ) + ), + array( + 'Authorization (PHP_AUTH_USER + PHP_AUTH_PW)', + array( + 'Authorization' => 'Basic ' . base64_encode('foo:bar') + ), + array( + 'PHP_AUTH_USER' => 'foo', + 'PHP_AUTH_PW' => 'bar' + ) + ), + array( + 'Authorization (PHP_AUTH_DIGEST)', + array( + 'Authorization' => 'example-digest' + ), + array( + 'PHP_AUTH_DIGEST' => 'example-digest' + ) + ) + ); + } +} diff --git a/vendor/sepia/po-parser/.gitignore b/vendor/sepia/po-parser/.gitignore new file mode 100644 index 00000000..5cca9e0b --- /dev/null +++ b/vendor/sepia/po-parser/.gitignore @@ -0,0 +1,3 @@ +vendor +composer.phar +composer.lock \ No newline at end of file diff --git a/vendor/sepia/po-parser/.scrutinizer.yml b/vendor/sepia/po-parser/.scrutinizer.yml new file mode 100644 index 00000000..d792487e --- /dev/null +++ b/vendor/sepia/po-parser/.scrutinizer.yml @@ -0,0 +1,26 @@ +before_commands: + - "composer install --prefer-source" + +tools: + php_code_coverage: + enabled: true + php_code_sniffer: + enabled: true + config: + standard: PSR2 + filter: + paths: ["src/*", "tests/*"] + php_cpd: + enabled: true + excluded_dirs: ["build/*", "tests", "vendor"] + php_analyzer: + enabled: true + filter: + paths: ["src/*", "tests/*"] + php_mess_detector: + enabled: true + filter: + paths: ["src/*"] + php_pdepend: + enabled: true + excluded_dirs: ["build", "tests", "vendor"] diff --git a/vendor/sepia/po-parser/.travis.yml b/vendor/sepia/po-parser/.travis.yml new file mode 100644 index 00000000..0c4ca2f0 --- /dev/null +++ b/vendor/sepia/po-parser/.travis.yml @@ -0,0 +1,14 @@ +language: php + +php: + - 5.4 + - 5.5 + - 7.0 + - 7.1 + +before_script: + - composer self-update + - composer update --prefer-source; composer install --dev --prefer-source; + +script: + - ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml diff --git a/vendor/sepia/po-parser/build/.gitignore b/vendor/sepia/po-parser/build/.gitignore new file mode 100644 index 00000000..6d8e8bfe --- /dev/null +++ b/vendor/sepia/po-parser/build/.gitignore @@ -0,0 +1,4 @@ +* +!logs +!.gitignore +!coverage-checker.php \ No newline at end of file diff --git a/vendor/sepia/po-parser/changelog.md b/vendor/sepia/po-parser/changelog.md new file mode 100644 index 00000000..5259d5a4 --- /dev/null +++ b/vendor/sepia/po-parser/changelog.md @@ -0,0 +1,68 @@ +v5.1.5 (2018-04-17) +* Fix #79 Prevent splitting multibyte characters across lines (thanks @chrisminett) + +v5.1.4 (2018-04-05) +* Fix #86 by making parseFile and parseString both return a Catalog + +v5.1.3 (2018-03-28) +* Fix #83, double escaped special characters. +* Add support for `msgid_plural` in `EntryFactory::createFromArray` + +v5.1.2 (2018-02-26) +* Fix PoCompiler by adding missing quotes and \n in headers. + +v5.1.1 (2018-02-10) +* Header::setHeaders() to allow modifying PO headers. + +v5.1 (2018-02-04) +* Parser::parser() optionally accepts a Catalog interface implementation. +* Parser refactor for easier maintenance. +* Fix parsing comments without space between `#` and text. +* Fix parsing multiline Headers. +* Improve Compiler by creating an empty `msgstr[n]` for every plural form defined. +* Improve parsing headers by offering a base for more granular interpretation. + +v5.0 (2018-02-02) +* Backwards incompatible version! Check [v5 Documentation]() and [Migration guide]() for more information. +* Refactored to avoid usage issues like [this](https://github.com/raulferras/PHP-po-parser/issues/67), [this](https://github.com/raulferras/PHP-po-parser/issues/62), [this](https://github.com/raulferras/PHP-po-parser/issues/52), [this](https://github.com/raulferras/PHP-po-parser/issues/50) +* PSR-4 +* New feature: All entry properties of an entry can now be edited. +* New feature: Output files wraps long strings. +* Fixes parsing previous strings wrapped in multiple lines. +* Fix: Obsolete entries were ignoring `msgctxt` properties. +* Fix: Obsolete entries does not output `msgstr` properties. +* Fixes some corner cases reported. +* More tests! +* Main deprecations (check [Migration guide]() for more information.): + - Namespace changed to `Sepia\PoParser` + - `PoParser` renamed to `Parser` + - `parser` method does not return an array anymore, instead a `CatalogArray` object. + - No need for options anymore. + +v4.2.2 +* More PHPDocs fixes +* Strict comparisons used where safe. +* Fix example for `writeFile`. +* Support for EOL line formatting. + +v4.2.1 +* Support multiline for plural entries (thanks @Ben-Ho) + +v4.2.0 +* Add function to add plural and context to existing entry (thanks @Ben-Ho) +* Add ability to change msg id of entry (thanks @wildex) + +v4.1.1 +* Fixes with multi-flags entries (thanks @gnouet) + +v4.1 +* Constructor now accepts options to define separator used in multiline msgid entries. +* New method `getOptions()`. + +v4.0 + +* new methods parseString() and parseFile() replace the old parse()` +* new method writeFile() replaces the old write(). +* new method compile() which takes all parsed entries and coverts back to a PO formatted string. + +[See whole changelog](https://github.com/raulferras/PHP-po-parser/wiki/Changelog) diff --git a/vendor/sepia/po-parser/composer.json b/vendor/sepia/po-parser/composer.json new file mode 100644 index 00000000..0f310848 --- /dev/null +++ b/vendor/sepia/po-parser/composer.json @@ -0,0 +1,38 @@ +{ + "name": "sepia/po-parser", + "description": "Gettext *.PO file parser for PHP.", + "type": "library", + "keywords": [ + "i18n", + "i10n", + "po", + "gettext" + ], + "homepage": "https://github.com/raulferras/PHP-po-parser", + "license": "MIT", + "authors": [ + { + "name": "Raúl Ferràs", + "email": "raul.ferras@gmail.com", + "role": "developer" + } + ], + "support": { + "issues": "https://github.com/raulferras/PHP-po-parser/issues" + }, + "require": { + "php": ">=5.3", + "symfony/polyfill-mbstring": "^1" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^2.0", + "fzaninotto/faker": "^1.7", + "phpunit/phpunit": "^4.0" + }, + "autoload": { + "psr-4": { + "Sepia\\PoParser\\": "src/", + "Sepia\\Test\\": "tests/" + } + } +} diff --git a/vendor/sepia/po-parser/fixtures/basic.po b/vendor/sepia/po-parser/fixtures/basic.po new file mode 100644 index 00000000..1ccc8428 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basic.po @@ -0,0 +1,5 @@ +msgid "string.1" +msgstr "translation.1" + +msgid "string.2" +msgstr "translation \"quoted\"" \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/basicCollection.po b/vendor/sepia/po-parser/fixtures/basicCollection.po new file mode 100644 index 00000000..f35738f6 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicCollection.po @@ -0,0 +1,5 @@ +msgid "string.1" +msgstr "translation.1" + +msgid "string.2" +msgstr "translation.2" diff --git a/vendor/sepia/po-parser/fixtures/basicCustomHeaders.po b/vendor/sepia/po-parser/fixtures/basicCustomHeaders.po new file mode 100644 index 00000000..576da87f --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicCustomHeaders.po @@ -0,0 +1,13 @@ +msgid "" +msgstr "" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ../..\n" +"X-Poedit-SearchPath-2: ../../../modules\n" + +msgid "string.1" +msgstr "translation.1" diff --git a/vendor/sepia/po-parser/fixtures/basicHeader.po b/vendor/sepia/po-parser/fixtures/basicHeader.po new file mode 100644 index 00000000..b0d68eb0 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicHeader.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"Project-Id-Version: volga-volga.local\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-07-08 07:51+0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ../..\n" +"X-Poedit-SearchPath-2: ../../../modules\n" + +msgid "string.1" +msgstr "translation.1" diff --git a/vendor/sepia/po-parser/fixtures/basicHeadersMultiline.po b/vendor/sepia/po-parser/fixtures/basicHeadersMultiline.po new file mode 100644 index 00000000..9c767e3e --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicHeadersMultiline.po @@ -0,0 +1,9 @@ +msgid "" +msgstr "" +"Project-Id-Version: myproject\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"POT-Creation-Date: 2017-10-10 16:50+0200\n" + +msgid "string.1" +msgstr "translation.1" \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/basicMultiline.po b/vendor/sepia/po-parser/fixtures/basicMultiline.po new file mode 100644 index 00000000..2ab2d007 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicMultiline.po @@ -0,0 +1,5 @@ +msgid "" +"string.1" +msgstr "" +"translation line 1 " +"translation line 2" diff --git a/vendor/sepia/po-parser/fixtures/basicOnlyHeader.po b/vendor/sepia/po-parser/fixtures/basicOnlyHeader.po new file mode 100644 index 00000000..a1a8c096 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicOnlyHeader.po @@ -0,0 +1,19 @@ +msgid "" +msgstr "" +"Project-Id-Version: volga-volga.local\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-07-08 07:51+0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ../..\n" +"X-Poedit-SearchPath-2: ../../../modules\n" diff --git a/vendor/sepia/po-parser/fixtures/basicReference.po b/vendor/sepia/po-parser/fixtures/basicReference.po new file mode 100644 index 00000000..30195879 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/basicReference.po @@ -0,0 +1,3 @@ +#: src/views/forms.php:44 +msgid "string.1" +msgstr "translation.1" diff --git a/vendor/sepia/po-parser/fixtures/codeComments.po b/vendor/sepia/po-parser/fixtures/codeComments.po new file mode 100644 index 00000000..4828d7ca --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/codeComments.po @@ -0,0 +1,4 @@ +#. code comment +#. code translator comment +msgid "string.1" +msgstr "translation.1" diff --git a/vendor/sepia/po-parser/fixtures/context.po b/vendor/sepia/po-parser/fixtures/context.po new file mode 100644 index 00000000..30341c30 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/context.po @@ -0,0 +1,6 @@ +msgid "string.1" +msgctxt "register" +msgstr "translation.1" + +msgid "string.1" +msgstr "translation.2" \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/multiflags.po b/vendor/sepia/po-parser/fixtures/multiflags.po new file mode 100644 index 00000000..7ec702e1 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/multiflags.po @@ -0,0 +1,23 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-25 15:55+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Raúl Ferràs \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" + +#: wp-admin/custom-background.php:305 +#, php-format, fuzzy +msgctxt "Background Attachment" +msgid "Attachment" +msgstr "Adjunto" diff --git a/vendor/sepia/po-parser/fixtures/noblankline.po b/vendor/sepia/po-parser/fixtures/noblankline.po new file mode 100644 index 00000000..eeee93b3 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/noblankline.po @@ -0,0 +1,4 @@ +msgid "one" +msgstr "uno" +msgid "two" +msgstr "dos" \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/oldEntries.po b/vendor/sepia/po-parser/fixtures/oldEntries.po new file mode 100644 index 00000000..a8f03170 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/oldEntries.po @@ -0,0 +1,3 @@ +# @ default +#~ msgid "Arrastra imagenes aquí para subirlas." +#~ msgstr "Arrossega les teves imatges aquí per pujarles." \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/plurals.po b/vendor/sepia/po-parser/fixtures/plurals.po new file mode 100644 index 00000000..61405709 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/plurals.po @@ -0,0 +1,90 @@ +# Translation of Administration in Spanish (Spain) +# This file is distributed under the same license as the Administration package. +msgid "" +msgstr "" +"PO-Revision-Date: 2013-10-23 09:51:48+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/0.1\n" +"Project-Id-Version: Administration\n" + + +#: wp-admin/edit.php:238 +msgid "%s post not updated, somebody is editing it." +msgid_plural "%s posts not updated, somebody is editing them." +msgstr[0] "%s entrada no actualizada, alguien la está editando." +msgstr[1] "%s entradas no actualizadas, alguien las está editando." + +#: wp-admin/edit.php:239 +msgid "%s post permanently deleted." +msgid_plural "%s posts permanently deleted." +msgstr[0] "%s entrada borrada permanentemente." +msgstr[1] "%s entradas borradas permanentemente." + +#: wp-admin/edit.php:240 +msgid "%s post moved to the Trash." +msgid_plural "%s posts moved to the Trash." +msgstr[0] "%s entrada movida a la Papelera." +msgstr[1] "%s entradas movidas a la Papelera." + +#: wp-admin/edit.php:241 +msgid "%s post restored from the Trash." +msgid_plural "%s posts restored from the Trash." +msgstr[0] "%s entrada restaurada desde la Papelera." +msgstr[1] "%s entradas restauradas desde la Papelera." + +#: wp-admin/edit.php:244 +msgid "%s page updated." +msgid_plural "%s pages updated." +msgstr[0] "%s página actualizada." +msgstr[1] "%s páginas actualizadas." + +#: wp-admin/edit.php:245 +msgid "%s page not updated, somebody is editing it." +msgid_plural "%s pages not updated, somebody is editing them." +msgstr[0] "%s página no actualizada, alguien la está editando." +msgstr[1] "%s páginas no actualizadas, alguien las está editando." + +#: wp-admin/edit.php:246 +msgid "%s page permanently deleted." +msgid_plural "%s pages permanently deleted." +msgstr[0] "%s página borrada permanentemente." +msgstr[1] "%s páginas borradas permanentemente." + +#: wp-admin/edit.php:247 +msgid "%s page moved to the Trash." +msgid_plural "%s pages moved to the Trash." +msgstr[0] "%s página movida a la Papelera." +msgstr[1] "%s páginas movidas a la Papelera." + +#: wp-admin/edit.php:248 +msgid "%s page restored from the Trash." +msgid_plural "%s pages restored from the Trash." +msgstr[0] "%s página restaurapada desde la Papelera." +msgstr[1] "%s páginas restauradas desde la Papelera." + +#: wp-admin/revision.php:107 +msgid "Compare two different revisions by selecting the “Compare any two revisions” box to the side." +msgstr "Compara dos revisiones seleccionando “Compara dos revisiones cualquiera” en el lateral." + +#: wp-admin/includes/template.php:1891 +msgid "Compare Revisions" +msgstr "Comparar revisiones" + +#: wp-admin/includes/class-wp-ms-themes-list-table.php:207 +msgid "Broken (%s)" +msgid_plural "Broken (%s)" +msgstr[0] "Roto (%s)" +msgstr[1] "Rotos (%s)" + +#: wp-admin/includes/theme.php:169 +msgid "Light" +msgstr "Ligero" + +msgid "http://akismet.com/?return=true" +msgstr "http://akismet.com/?return=true" + +msgid "Used by millions, Akismet is quite possibly the best way in the world to protect your blog from comment and trackback spam. It keeps your site protected from spam even while you sleep. To get started: 1) Click the \"Activate\" link to the left of this description, 2) Sign up for an Akismet API key, and 3) Go to your Akismet configuration page, and save your API key." +msgstr "Utilizado por millones de usuarios, Akismet es probablemente el mejor modo que hay en el mundo para proteger tu sitio de spam en comentarios y trackbacks. Mantiene tu sitio protegido de spam incluso mientras duermes. Para empezar: 1) Haz clic en el enlace \"Activar\" a la izquierda de la descripción, 2) Regístrate para obtener una clave API de Akismet, y 3) Ve a tu página de configuración de Akismet y guarda tu clave API." diff --git a/vendor/sepia/po-parser/fixtures/pluralsMultiline.po b/vendor/sepia/po-parser/fixtures/pluralsMultiline.po new file mode 100644 index 00000000..d1506aee --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/pluralsMultiline.po @@ -0,0 +1,19 @@ +msgid "%s post not updated," +"somebody is editing it." +msgid_plural "%s posts not updated," +"somebody is editing them." +msgstr[0] "%s entrada no actualizada," +"alguien la está editando." +msgstr[1] "%s entradas no actualizadas," +"alguien las está editando." + +#: wp-admin/edit.php:239 +msgid "" +"%s post permanently deleted." +msgid_plural "%s posts permanently deleted." +msgstr[0] "" +"%s entrada borrada" +"permanentemente." +msgstr[1] "" +"%s entradas borradas" +"permanentemente." diff --git a/vendor/sepia/po-parser/fixtures/previousString.po b/vendor/sepia/po-parser/fixtures/previousString.po new file mode 100644 index 00000000..691b5fa2 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/previousString.po @@ -0,0 +1,5 @@ +#| msgid "this is a previous string" +#| msgstr "this is a previous translation string" +msgid "this is a string" +msgstr "this is a translation" + diff --git a/vendor/sepia/po-parser/fixtures/previousStringMultiline.po b/vendor/sepia/po-parser/fixtures/previousStringMultiline.po new file mode 100644 index 00000000..5c96fb4f --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/previousStringMultiline.po @@ -0,0 +1,10 @@ + + + +#| msgid "this is a previous string" +#| msgstr "" +#| "Doloribus nulla odit et aut est. Rerum molestiae pariatur suscipit unde in quide" +#| "m alias alias. Ut ea omnis placeat rerum quae asperiores. Et recusandae praesent" +#| "ium ea." +msgid "this is a string" +msgstr "this is a translation" \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/quotes.po b/vendor/sepia/po-parser/fixtures/quotes.po new file mode 100644 index 00000000..a1383413 --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/quotes.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"POT-Creation-Date: 2018-03-05 08:57+0100\n" +"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" +"Last-Translator: NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +msgid "a\nb\nc" +msgstr "linebreaks" + +msgid "a\"b\"c" +msgstr "quotes" \ No newline at end of file diff --git a/vendor/sepia/po-parser/fixtures/translatorComments.po b/vendor/sepia/po-parser/fixtures/translatorComments.po new file mode 100644 index 00000000..2c6fc93b --- /dev/null +++ b/vendor/sepia/po-parser/fixtures/translatorComments.po @@ -0,0 +1,4 @@ +# translator comment +#second translator comment +msgid "string.1" +msgstr "translation.1" diff --git a/vendor/sepia/po-parser/license.txt b/vendor/sepia/po-parser/license.txt new file mode 100644 index 00000000..df095f12 --- /dev/null +++ b/vendor/sepia/po-parser/license.txt @@ -0,0 +1,28 @@ +The MIT License (MIT) + +Copyright (c) 2012 Raúl Ferràs raul.ferras@gmail.com +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sepia/po-parser/phpunit.xml b/vendor/sepia/po-parser/phpunit.xml new file mode 100644 index 00000000..34665507 --- /dev/null +++ b/vendor/sepia/po-parser/phpunit.xml @@ -0,0 +1,8 @@ + + + + + ./tests + + + \ No newline at end of file diff --git a/vendor/sepia/po-parser/readme.md b/vendor/sepia/po-parser/readme.md new file mode 100644 index 00000000..bc7cfa58 --- /dev/null +++ b/vendor/sepia/po-parser/readme.md @@ -0,0 +1,91 @@ +PoParser +======= +PoParser is a personal project to fulfill a need I got: parse Gettext Portable files (*.po files) and edit its content using PHP. + +PoParser requires PHP >= 5.4, but may work in 5.3 too. +[Changelog](changelog.md) + +[![Latest Stable Version](https://poser.pugx.org/sepia/po-parser/v/stable)](https://packagist.org/packages/sepia/po-parser) +[![Total Downloads](https://poser.pugx.org/sepia/po-parser/downloads)](https://packagist.org/packages/sepia/po-parser) +[![License](https://poser.pugx.org/sepia/po-parser/license)](https://packagist.org/packages/sepia/po-parser) +[![Build Status](https://travis-ci.org/raulferras/PHP-po-parser.png?branch=master)](https://travis-ci.org/raulferras/PHP-po-parser) +[![Code Coverage](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/coverage.png?s=a19ece2a8543b085ab1a5db319ded3bc4530b567)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/) +[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/quality-score.png?s=6aaf3c31ce15cebd1d4bed718cd41fd2d921fd31)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/) + +[![Gitter](https://badges.gitter.im/raulferras/PHP-po-parser.svg)](https://gitter.im/raulferras/PHP-po-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + + +Features +======== +It supports following parsing features: + +- header section. +- msgid, both single and multiline. +- msgstr, both single and multiline. +- msgctxt (Message context). +- msgid_plural (plurals forms). +- #, keys (flags). +- # keys (translator comments). +- #. keys (Comments extracted from source code). +- #: keys (references). +- #| keys (previous strings), both single and multiline. +- #~ keys (old entries), both single and multiline. + +Installation +============ + +``` +composer require sepia/po-parser +``` + +Usage +===== +``` +parse(); + +// Get an entry +$entry = $catalog->getEntry('welcome.user'); + +// Update entry +$entry = new Entry('welcome.user', 'Welcome User!'); +$catalog->setEntry($entry); + +// You can also modify other entry attributes as translator comments, code comments, flags... +$entry->setTranslatorComments(array('This is shown whenever a new user registers in the website')); +$entry->setFlags(array('fuzzy', 'php-code')); +``` + +## Save Changes back to a file +Use `PoCompiler` together with `FileSystem` to save a catalog back to a file: + +``` +$fileHandler = new Sepia\PoParser\SourceHandler\FileSystem('en.po'); +$compiler = new Sepia\PoParser\PoCompiler(); +$fileHandler->save($compiler->compile($catalog)); +``` + +Documentation +============= +- [v5 Documentation](https://github.com/raulferras/PHP-po-parser/wiki/Documentation-5.0) +- [Migration guide from v4 to v5](https://github.com/raulferras/PHP-po-parser/wiki/Migration-v4-to-v5) +- [v4 documentation](https://github.com/raulferras/PHP-po-parser/wiki/Documentation-4.0) + + +Testing +======= +Tests are done using PHPUnit. +To execute tests, from command line type: + +``` +php vendor/bin/phpunit +``` + + +TODO +==== +* Add compatibility with older disambiguating contexts formats. diff --git a/vendor/sepia/po-parser/src/Catalog/Catalog.php b/vendor/sepia/po-parser/src/Catalog/Catalog.php new file mode 100644 index 00000000..7d718f71 --- /dev/null +++ b/vendor/sepia/po-parser/src/Catalog/Catalog.php @@ -0,0 +1,39 @@ +entries = array(); + $this->headers = new Header(); + foreach ($entries as $entry) { + $this->addEntry($entry); + } + } + + /** + * {@inheritdoc} + */ + public function addEntry(Entry $entry) + { + $key = $this->getEntryHash( + $entry->getMsgId(), + $entry->getMsgCtxt() + ); + $this->entries[$key] = $entry; + } + + /** + * {@inheritdoc} + */ + public function addHeaders(Header $headers) + { + $this->headers = $headers; + } + + /** + * {@inheritdoc} + */ + public function removeEntry($msgid, $msgctxt = null) + { + $key = $this->getEntryHash($msgid, $msgctxt); + if (isset($this->entries[$key])) { + unset($this->entries[$key]); + } + } + + /** + * {@inheritdoc} + */ + public function getHeaders() + { + return $this->headers->asArray(); + } + + /** + * {@inheritdoc} + */ + public function getHeader() + { + return $this->headers; + } + + /** + * {@inheritdoc} + */ + public function getEntries() + { + return $this->entries; + } + + /** + * {@inheritdoc} + */ + public function getEntry($msgId, $context = null) + { + $key = $this->getEntryHash($msgId, $context); + if (!isset($this->entries[$key])) { + return null; + } + + return $this->entries[$key]; + } + + /** + * @param string $msgId + * @param string|null $context + * + * @return string + */ + private function getEntryHash($msgId, $context = null) + { + return md5($msgId.$context); + } +} diff --git a/vendor/sepia/po-parser/src/Catalog/Entry.php b/vendor/sepia/po-parser/src/Catalog/Entry.php new file mode 100644 index 00000000..e59369f2 --- /dev/null +++ b/vendor/sepia/po-parser/src/Catalog/Entry.php @@ -0,0 +1,290 @@ +msgId = $msgId; + $this->msgStr = $msgStr; + $this->msgStrPlurals = array(); + $this->flags = array(); + $this->translatorComments = array(); + $this->developerComments = array(); + $this->reference = array(); + } + + /** + * @param string $msgId + * + * @return Entry + */ + public function setMsgId($msgId) + { + $this->msgId = $msgId; + + return $this; + } + + /** + * @param string $msgStr + * + * @return Entry + */ + public function setMsgStr($msgStr) + { + $this->msgStr = $msgStr; + + return $this; + } + + /** + * @param string $msgIdPlural + * + * @return Entry + */ + public function setMsgIdPlural($msgIdPlural) + { + $this->msgIdPlural = $msgIdPlural; + + return $this; + } + + /** + * @param string $msgCtxt + * + * @return Entry + */ + public function setMsgCtxt($msgCtxt) + { + $this->msgCtxt = $msgCtxt; + + return $this; + } + + /** + * @param null|Entry $previousEntry + * + * @return Entry + */ + public function setPreviousEntry($previousEntry) + { + $this->previousEntry = $previousEntry; + + return $this; + } + + /** + * @param bool $obsolete + * + * @return Entry + */ + public function setObsolete($obsolete) + { + $this->obsolete = $obsolete; + + return $this; + } + + /** + * @param array $flags + * + * @return Entry + */ + public function setFlags($flags) + { + $this->flags = $flags; + + return $this; + } + + /** + * @param array $translatorComments + * + * @return Entry + */ + public function setTranslatorComments($translatorComments) + { + $this->translatorComments = $translatorComments; + + return $this; + } + + /** + * @param array $developerComments + * + * @return Entry + */ + public function setDeveloperComments($developerComments) + { + $this->developerComments = $developerComments; + + return $this; + } + + /** + * @param array $reference + * + * @return Entry + */ + public function setReference($reference) + { + $this->reference = $reference; + + return $this; + } + + /** + * @param string[] $msgStrPlurals + * + * @return Entry + */ + public function setMsgStrPlurals($msgStrPlurals) + { + $this->msgStrPlurals = $msgStrPlurals; + + return $this; + } + + /** + * @return string + */ + public function getMsgId() + { + return $this->msgId; + } + + /** + * @return string + */ + public function getMsgStr() + { + return $this->msgStr; + } + + /** + * @return string + */ + public function getMsgIdPlural() + { + return $this->msgIdPlural; + } + + /** + * @return string|null + */ + public function getMsgCtxt() + { + return $this->msgCtxt; + } + + /** + * @return null|Entry + */ + public function getPreviousEntry() + { + return $this->previousEntry; + } + + /** + * @return bool + */ + public function isObsolete() + { + return $this->obsolete === true; + } + + /** + * @return bool + */ + public function isFuzzy() + { + return in_array('fuzzy', $this->getFlags(), true); + } + + /** + * @return bool + */ + public function isPlural() + { + return $this->getMsgIdPlural() !== null || count($this->getMsgStrPlurals()) > 0; + } + + /** + * @return array + */ + public function getFlags() + { + return $this->flags; + } + + /** + * @return array + */ + public function getTranslatorComments() + { + return $this->translatorComments; + } + + /** + * @return array + */ + public function getDeveloperComments() + { + return $this->developerComments; + } + + /** + * @return array + */ + public function getReference() + { + return $this->reference; + } + + /** + * @return string[] + */ + public function getMsgStrPlurals() + { + return $this->msgStrPlurals; + } +} diff --git a/vendor/sepia/po-parser/src/Catalog/EntryFactory.php b/vendor/sepia/po-parser/src/Catalog/EntryFactory.php new file mode 100644 index 00000000..2c93dbc3 --- /dev/null +++ b/vendor/sepia/po-parser/src/Catalog/EntryFactory.php @@ -0,0 +1,64 @@ + $value) { + switch (true) { + case $key === 'msgctxt': + $entry->setMsgCtxt($entryArray['msgctxt']); + break; + + case $key === 'flags': + $entry->setFlags($entryArray['flags']); + break; + + case $key === 'reference': + $entry->setReference($entryArray['reference']); + break; + + case $key === 'previous': + $entry->setPreviousEntry(self::createFromArray($entryArray['previous'])); + break; + + case $key === 'tcomment': + $entry->setTranslatorComments($value); + break; + + case $key === 'ccomment': + $entry->setDeveloperComments($value); + break; + + case $key === 'obsolete': + $entry->setObsolete(true); + break; + + case 0 === strpos($key, 'msgstr['): + $plurals[] = $value; + break; + } + } + + if (count($plurals) > 0) { + $entry->setMsgStrPlurals($plurals); + if(!empty($entryArray['msgid_plural'])){ + $entry->setMsgIdPlural($entryArray['msgid_plural']); + } + } + + return $entry; + } +} diff --git a/vendor/sepia/po-parser/src/Catalog/Header.php b/vendor/sepia/po-parser/src/Catalog/Header.php new file mode 100644 index 00000000..d31210e9 --- /dev/null +++ b/vendor/sepia/po-parser/src/Catalog/Header.php @@ -0,0 +1,70 @@ +setHeaders($headers); + } + + public function getPluralFormsCount() + { + if ($this->nPlurals !== null) { + return $this->nPlurals; + } + + $header = $this->getHeaderValue('Plural-Forms'); + if ($header === null) { + $this->nPlurals = 0; + return $this->nPlurals; + } + + $matches = array(); + if (preg_match('/nplurals=([0-9]+)/', $header, $matches) !== 1) { + $this->nPlurals = 0; + return $this->nPlurals; + } + + $this->nPlurals = isset($matches[1]) ? (int)$matches[1] : 0; + + return $this->nPlurals; + } + + public function setHeaders(array $headers) + { + $this->headers = $headers; + } + + /** + * @return array + */ + public function asArray() + { + return $this->headers; + } + + /** + * @param string $headerName + * + * @return string|null + */ + protected function getHeaderValue($headerName) + { + $header = array_values(array_filter( + $this->headers, + function ($string) use ($headerName) { + return preg_match('/'.$headerName.':(.*)/i', $string) == 1; + } + )); + + return count($header) ? $header[0] : null; + } +} diff --git a/vendor/sepia/po-parser/src/Exception/ParseException.php b/vendor/sepia/po-parser/src/Exception/ParseException.php new file mode 100644 index 00000000..789d8cc5 --- /dev/null +++ b/vendor/sepia/po-parser/src/Exception/ParseException.php @@ -0,0 +1,7 @@ +parse(); + } + + /** + * Reads and parses a file + * + * @param string $filePath + * + * @throws \Exception. + * @return Catalog + */ + public static function parseFile($filePath) + { + $parser = new Parser(new FileSystem($filePath)); + + return $parser->parse(); + } + + public function __construct(SourceHandler $sourceHandler) + { + $this->sourceHandler = $sourceHandler; + } + + /** + * Reads and parses strings of a .po file. + * + * @param SourceHandler . Optional + * + * @throws \Exception, \InvalidArgumentException, ParseException + * @return Catalog + */ + public function parse(Catalog $catalog = null) + { + $catalog = $catalog === null ? new CatalogArray() : $catalog; + $this->lineNumber = 0; + $entry = array(); + $this->property = null; // current property + + // Flags + $headersFound = false; + + while (!$this->sourceHandler->ended()) { + $line = trim($this->sourceHandler->getNextLine()); + + if ($this->shouldIgnoreLine($line, $entry)) { + $this->lineNumber++; + continue; + } + + if ($this->shouldCloseEntry($line, $entry)) { + if (!$headersFound && $this->isHeader($entry)) { + $headersFound = true; + $catalog->addHeaders( + $this->parseHeaders($entry['msgstr']) + ); + } else { + $catalog->addEntry(EntryFactory::createFromArray($entry)); + } + + $entry = array(); + $this->property = null; + + if (empty($line)) { + $this->lineNumber++; + continue; + } + } + + $entry = $this->parseLine($line, $entry); + + $this->lineNumber++; + continue; + } + $this->sourceHandler->close(); + + // add final entry + if (count($entry)) { + if ($this->isHeader($entry)) { + $catalog->addHeaders( + $this->parseHeaders($entry['msgstr']) + ); + } else { + $catalog->addEntry(EntryFactory::createFromArray($entry)); + } + } + + return $catalog; + } + + /** + * @param string $line + * @param array $entry + * + * @return array + * @throws ParseException + */ + protected function parseLine($line, $entry) + { + $firstChar = strlen($line) > 0 ? $line[0] : ''; + + switch ($firstChar) { + case '#': + $entry = $this->parseComment($line, $entry); + break; + + case 'm': + $entry = $this->parseProperty($line, $entry); + break; + + case '"': + $entry = $this->parseMultiline($line, $entry); + break; + } + + return $entry; + } + + /** + * @param string $line + * @param array $entry + * + * @return array + * @throws ParseException + */ + protected function parseProperty($line, array $entry) + { + list($key, $value) = $this->getProperty($line); + + if (!isset($entry[$key])) { + $entry[$key] = ''; + } + + switch (true) { + case $key === 'msgctxt': + case $key === 'msgid': + case $key === 'msgid_plural': + case $key === 'msgstr': + $entry[$key] .= $this->unquote($value); + $this->property = $key; + break; + + case strpos($key, 'msgstr[') !== false: + $entry[$key] .= $this->unquote($value); + $this->property = $key; + break; + + default: + throw new ParseException(sprintf('Could not parse %s at line %d', $key, $this->lineNumber)); + } + + return $entry; + } + + /** + * @param string $line + * @param array $entry + * + * @return array + * @throws ParseException + */ + protected function parseMultiline($line, $entry) + { + switch (true) { + case $this->property === 'msgctxt': + case $this->property === 'msgid': + case $this->property === 'msgid_plural': + case $this->property === 'msgstr': + case strpos($this->property, 'msgstr[') !== false: + $entry[$this->property] .= $this->unquote($line); + break; + + default: + throw new ParseException( + sprintf('Error parsing property %s as multiline.', $this->property) + ); + } + + return $entry; + } + + /** + * @param string $line + * @param array $entry + * + * @return array + * @throws ParseException + */ + protected function parseComment($line, $entry) + { + $comment = trim(substr($line, 0, 2)); + + switch ($comment) { + case '#,': + $line = trim(substr($line, 2)); + $entry['flags'] = preg_split('/,\s*/', $line); + break; + + case '#.': + $entry['ccomment'] = !isset($entry['ccomment']) ? array() : $entry['ccomment']; + $entry['ccomment'][] = trim(substr($line, 2)); + break; + + + case '#|': // Previous string + case '#~': // Old entry + case '#~|': // Previous string old + $mode = array( + '#|' => 'previous', + '#~' => 'obsolete', + '#~|' => 'previous-obsolete' + ); + + $line = trim(substr($line, 2)); + $property = $mode[$comment]; + if ($property === 'previous') { + if (!isset($entry[$property])) { + $subEntry = array(); + } else { + $subEntry = $entry[$property]; + } + + $subEntry = $this->parseLine($line, $subEntry); + //$subEntry = $this->parseProperty($line, $subEntry); + $entry[$property] = $subEntry; + } else { + $entry = $this->parseLine($line, $entry); + $entry['obsolete'] = true; + } + break; + + // Reference + case '#:': + $entry['reference'][] = trim(substr($line, 2)); + break; + + case '#': + default: + $entry['tcomment'] = !isset($entry['tcomment']) ? array() : $entry['tcomment']; + $entry['tcomment'][] = trim(substr($line, 1)); + break; + } + + return $entry; + } + + /** + * @param string $msgstr + * + * @return Header + */ + protected function parseHeaders($msgstr) + { + $headers = array_filter(explode('\\n', $msgstr)); + + return new Header($headers); + } + + /** + * @param string $line + * @param array $entry + * + * @return bool + */ + protected function shouldIgnoreLine($line, array $entry) + { + return empty($line) && count($entry) === 0; + } + + /** + * @param string $line + * @param array $entry + * + * @return bool + */ + protected function shouldCloseEntry($line, array $entry) + { + $tokens = $this->getProperty($line); + $property = $tokens[0]; + + return ($line === '' || ($property === 'msgid' && isset($entry['msgid']))); + } + + /** + * @param string $value + * @return string + */ + protected function unquote($value) + { + return preg_replace('/^\"|\"$/', '', $value); + } + + /** + * Checks if entry is a header by + * + * @param array $entry + * + * @return bool + */ + protected function isHeader(array $entry) + { + if (empty($entry) || !isset($entry['msgstr'])) { + return false; + } + + if (!isset($entry['msgid']) || !empty($entry['msgid'])) { + return false; + } + + $standardHeaders = array( + 'Project-Id-Version:', + 'Report-Msgid-Bugs-To:', + 'POT-Creation-Date:', + 'PO-Revision-Date:', + 'Last-Translator:', + 'Language-Team:', + 'MIME-Version:', + 'Content-Type:', + 'Content-Transfer-Encoding:', + 'Plural-Forms:', + ); + + $headers = explode('\n', $entry['msgstr']); + // Remove text after double colon + $headers = array_map( + function ($header) { + $pattern = '/(.*?:)(.*)/i'; + $replace = '${1}'; + return preg_replace($pattern, $replace, $header); + }, + $headers + ); + + if (count(array_intersect($standardHeaders, $headers)) > 0) { + return true; + } + + // If it does not contain any of the standard headers + // Let's see if it contains any custom header. + $customHeaders = array_filter( + $headers, + function ($header) { + return preg_match('/^X\-(.*):/i', $header) === 1; + } + ); + + return count($customHeaders) > 0; + } + + /** + * @param string $line + * + * @return array + */ + protected function getProperty($line) + { + $tokens = preg_split('/\s+/ ', $line, 2); + + return $tokens; + } +} diff --git a/vendor/sepia/po-parser/src/PoCompiler.php b/vendor/sepia/po-parser/src/PoCompiler.php new file mode 100644 index 00000000..ed563799 --- /dev/null +++ b/vendor/sepia/po-parser/src/PoCompiler.php @@ -0,0 +1,285 @@ +wrappingColumn = $wrappingColumn; + $this->lineEnding = $lineEnding; + } + + /** + * Compiles entries into a string + * + * @param Catalog $catalog + * + * @return string + * @throws \Exception + * @todo Write obsolete messages at the end of the file. + */ + public function compile(Catalog $catalog) + { + $output = ''; + + if (count($catalog->getHeaders()) > 0) { + $output .= 'msgid ""'.$this->eol(); + $output .= 'msgstr ""'.$this->eol(); + foreach ($catalog->getHeaders() as $header) { + $output .= '"'.$header.'\n"'.$this->eol(); + } + $output .= $this->eol(); + } + + + $entriesCount = count($catalog->getEntries()); + $counter = 0; + foreach ($catalog->getEntries() as $entry) { + if ($entry->isObsolete() === false) { + $output .= $this->buildPreviousEntry($entry); + $output .= $this->buildTranslatorComment($entry); + $output .= $this->buildDeveloperComment($entry); + $output .= $this->buildReference($entry); + } + + $output .= $this->buildFlags($entry); + +// if (isset($entry['@'])) { +// $output .= "#@ ".$entry['@'].$this->eol(); +// } + + $output .= $this->buildContext($entry); + $output .= $this->buildMsgId($entry); + $output .= $this->buildMsgIdPlural($entry); + $output .= $this->buildMsgStr($entry, $catalog->getHeader()); + + + $counter++; + // Avoid inserting an extra newline at end of file + if ($counter < $entriesCount) { + $output .= $this->eol(); + } + } + + return $output; + } + + /** + * @return string + */ + protected function eol() + { + return $this->lineEnding; + } + + /** + * @param $entry + * + * @return string + */ + protected function buildPreviousEntry(Entry $entry) + { + $previous = $entry->getPreviousEntry(); + if ($previous === null) { + return ''; + } + + return '#| msgid '.$this->cleanExport($previous->getMsgId()).$this->eol(); + } + + /** + * @param $entry + * + * @return string + */ + protected function buildTranslatorComment(Entry $entry) + { + if ($entry->getTranslatorComments() === null) { + return ''; + } + + $output = ''; + foreach ($entry->getTranslatorComments() as $comment) { + $output .= '# '.$comment.$this->eol(); + } + + return $output; + } + + protected function buildDeveloperComment(Entry $entry) + { + if ($entry->getDeveloperComments() === null) { + return ''; + } + + $output = ''; + foreach ($entry->getDeveloperComments() as $comment) { + $output .= '#. '.$comment.$this->eol(); + } + + return $output; + } + + protected function buildReference(Entry $entry) + { + $reference = $entry->getReference(); + if ($reference === null || count($reference) === 0) { + return ''; + } + + $output = ''; + foreach ($reference as $ref) { + $output .= '#: '.$ref.$this->eol(); + } + + return $output; + } + + protected function buildFlags(Entry $entry) + { + $flags = $entry->getFlags(); + if ($flags === null || count($flags) === 0) { + return ''; + } + + return '#, '.implode(', ', $flags).$this->eol(); + } + + protected function buildContext(Entry $entry) + { + if ($entry->getMsgCtxt() === null) { + return ''; + } + + return + ($entry->isObsolete() ? '#~ ' : ''). + 'msgctxt '.$this->cleanExport($entry->getMsgCtxt()).$this->eol(); + } + + protected function buildMsgId(Entry $entry) + { + if ($entry->getMsgId() === null) { + return ''; + } + + return $this->buildProperty('msgid', $entry->getMsgId(), $entry->isObsolete()); + } + + protected function buildMsgStr(Entry $entry, Header $headers) + { + $value = $entry->getMsgStr(); + $plurals = $entry->getMsgStrPlurals(); + + if ($value === null && $plurals === null) { + return ''; + } + + if ($entry->isPlural()) { + $output = ''; + $nPlurals = $headers->getPluralFormsCount(); + $pluralsFound = count($plurals); + $maxIterations = max($nPlurals, $pluralsFound); + for ($i = 0; $i < $maxIterations; $i++) { + $value = isset($plurals[$i]) ? $plurals[$i] : ''; + $output .= 'msgstr['.$i.'] '.$this->cleanExport($value).$this->eol(); + } + + return $output; + } + + return $this->buildProperty('msgstr', $value, $entry->isObsolete()); + } + + /** + * @param Entry $entry + * + * @return string + */ + protected function buildMsgIdPlural(Entry $entry) + { + $value = $entry->getMsgIdPlural(); + if ($value === null) { + return ''; + } + + return 'msgid_plural '.$this->cleanExport($value).$this->eol(); + } + + protected function buildProperty($property, $value, $obsolete = false) + { + $tokens = $this->wrapString($value); + + $output = ''; + if (count($tokens) > 1) { + array_unshift($tokens, ''); + } + + foreach ($tokens as $i => $token) { + $output .= $obsolete ? self::TOKEN_OBSOLETE : ''; + $output .= ($i === 0) ? $property.' ' : ''; + $output .= $this->cleanExport($token).$this->eol(); + } + + return $output; + } + + /** + * Prepares a string to be outputed into a file. + * + * @param string $string The string to be converted. + * + * @return string + */ + protected function cleanExport($string) + { + $quote = '"'; + $slash = '\\'; + $newline = "\n"; + + // escape qoutes that are not allready escaped + $string = preg_replace('#(? $this->wrappingColumn) { + $tokens = array(); + for ($i = 0; $i < $length; $i += $this->wrappingColumn) { + $tokens[] = mb_substr($value, $i, $this->wrappingColumn); + } + } else { + $tokens = array($value); + } + + return $tokens; + } +} diff --git a/libs/PHP-po-parser-master/src/Sepia/FileHandler.php b/vendor/sepia/po-parser/src/SourceHandler/FileSystem.php similarity index 57% rename from libs/PHP-po-parser-master/src/Sepia/FileHandler.php rename to vendor/sepia/po-parser/src/SourceHandler/FileSystem.php index 3128bdfa..e847fa1c 100644 --- a/libs/PHP-po-parser-master/src/Sepia/FileHandler.php +++ b/vendor/sepia/po-parser/src/SourceHandler/FileSystem.php @@ -1,6 +1,6 @@ filePath = $filePath; + $this->fileHandle = null; + } + + /** + * @throws \Exception + */ + protected function openFile() { - if (file_exists($filepath) === false) { - throw new \Exception('PoParser: Input File does not exists: "' . htmlspecialchars($filepath) . '"'); - } elseif (is_readable($filepath) === false) { - throw new \Exception('PoParser: File is not readable: "' . htmlspecialchars($filepath) . '"'); + if ($this->fileHandle !== null) { + return; + } + + if (file_exists($this->filePath) === false) { + throw new \Exception('Parser: Input File does not exists: "' . htmlspecialchars($this->filePath) . '"'); + } + + if (is_readable($this->filePath) === false) { + throw new \Exception('Parser: File is not readable: "' . htmlspecialchars($this->filePath) . '"'); } - $this->fileHandle = @fopen($filepath, "r"); + $this->fileHandle = @fopen($this->filePath, 'rb'); if ($this->fileHandle===false) { - throw new \Exception('PoParser: Could not open file: "' . htmlspecialchars($filepath) . '"'); + throw new \Exception('Parser: Could not open file: "' . htmlspecialchars($this->filePath) . '"'); } } - + /** + * @return bool|string + * @throws \Exception + */ public function getNextLine() { + $this->openFile(); + return fgets($this->fileHandle); } + /** + * @return bool + * @throws \Exception + */ public function ended() { + $this->openFile(); + return feof($this->fileHandle); } public function close() { + if ($this->fileHandle === null) { + return true; + } + return @fclose($this->fileHandle); } - - public function save($outputFile) + /** + * @param $output + * @param $filePath + * + * @return bool + * @throws \Exception + */ + public function save($output) { + $result = file_put_contents($this->filePath, $output); + if ($result === false) { + throw new \Exception('Could not write into file '.htmlspecialchars($this->filePath)); + } + return true; } } \ No newline at end of file diff --git a/libs/PHP-po-parser-master/src/Sepia/InterfaceHandler.php b/vendor/sepia/po-parser/src/SourceHandler/SourceHandler.php similarity index 94% rename from libs/PHP-po-parser-master/src/Sepia/InterfaceHandler.php rename to vendor/sepia/po-parser/src/SourceHandler/SourceHandler.php index 5be14851..1653d23f 100644 --- a/libs/PHP-po-parser-master/src/Sepia/InterfaceHandler.php +++ b/vendor/sepia/po-parser/src/SourceHandler/SourceHandler.php @@ -1,6 +1,6 @@ line = 0; $this->strings = explode("\n",$string); @@ -65,9 +71,7 @@ public function close() $this->line = 0; } - public function save($ignore) { - } -} \ No newline at end of file +} diff --git a/vendor/sepia/po-parser/tests/AbstractFixtureTest.php b/vendor/sepia/po-parser/tests/AbstractFixtureTest.php new file mode 100644 index 00000000..daf74715 --- /dev/null +++ b/vendor/sepia/po-parser/tests/AbstractFixtureTest.php @@ -0,0 +1,32 @@ +resourcesPath = dirname(__DIR__).'/fixtures/'; + } + + /** + * @param string $file + * + * @return Catalog + */ + protected function parseFile($file) + { + //try { + return Parser::parseFile($this->resourcesPath.$file); + //} catch (\Exception $e) { + // $this->fail($e->getMessage()); + //} + } +} diff --git a/vendor/sepia/po-parser/tests/UnitTest/HeaderTest.php b/vendor/sepia/po-parser/tests/UnitTest/HeaderTest.php new file mode 100644 index 00000000..01490119 --- /dev/null +++ b/vendor/sepia/po-parser/tests/UnitTest/HeaderTest.php @@ -0,0 +1,24 @@ +parseFile(); + + $this->assertEquals(3, $catalog->getHeader()->getPluralFormsCount()); + } + + /** + * @return \Sepia\PoParser\Catalog\Catalog + */ + protected function parseFile() + { + return Parser::parseFile(dirname(dirname(__DIR__)).'/fixtures/basicHeadersMultiline.po'); + } +} diff --git a/vendor/sepia/po-parser/tests/UnitTest/ReadPoTest.php b/vendor/sepia/po-parser/tests/UnitTest/ReadPoTest.php new file mode 100644 index 00000000..82fbbd1e --- /dev/null +++ b/vendor/sepia/po-parser/tests/UnitTest/ReadPoTest.php @@ -0,0 +1,221 @@ +parseFile('basic.po'); + + $entry = $catalog->getEntry('string.1'); + + $this->assertNotNull($entry); + $this->assertEquals('string.1', $entry->getMsgId()); + $this->assertEquals('translation.1', $entry->getMsgStr()); + + $entry = $catalog->getEntry('string.2'); + $this->assertNotNull($entry); + $this->assertEquals('string.2', $entry->getMsgId()); + $this->assertEquals('translation \"quoted\"', $entry->getMsgStr()); + } + + public function testBasicMultiline() + { + $catalog = $this->parseFile('basicMultiline.po'); + + $entry = $catalog->getEntry('string.1'); + + $this->assertNotNull($entry); + $this->assertEquals('string.1', $entry->getMsgId()); + $this->assertEquals('translation line 1 translation line 2', $entry->getMsgStr()); + } + + public function testBasicCollection() + { + $catalog = $this->parseFile('basicCollection.po'); + + $this->assertCount(2, $catalog->getEntries()); + + $entry = $catalog->getEntry('string.1'); + $this->assertNotNull($entry); + $this->assertEquals('string.1', $entry->getMsgId()); + $this->assertEquals('translation.1', $entry->getMsgStr()); + + $entry = $catalog->getEntry('string.2'); + $this->assertNotNull($entry); + $this->assertEquals('string.2', $entry->getMsgId()); + $this->assertEquals('translation.2', $entry->getMsgStr()); + } + + public function testEntriesWithContext() + { + $catalog = $this->parseFile('context.po'); + + $withContext = $catalog->getEntry('string.1', 'register'); + $this->assertNotNull($withContext); + $this->assertEquals('register', $withContext->getMsgCtxt()); + + $withoutContext = $catalog->getEntry('string.1'); + $this->assertNotNull($withoutContext); + $this->assertEmpty($withoutContext->getMsgCtxt()); + $this->assertNotEquals($withContext, $withoutContext); + } + + public function testPlurals() + { + $catalog = $this->parseFile('plurals.po'); + + $entry = $catalog->getEntry('%s post not updated, somebody is editing it.'); + $this->assertNotNull($entry); + $this->assertNotEmpty($entry->getMsgStrPlurals()); + $this->assertEquals( + array( + '%s entrada no actualizada, alguien la está editando.', + '%s entradas no actualizadas, alguien las está editando.', + ), + $entry->getMsgStrPlurals() + ); + } + + public function testPluralsMultiline() + { + $catalog = $this->parseFile('pluralsMultiline.po'); + $entry = $catalog->getEntry('%s post not updated,somebody is editing it.'); + + $this->assertNotNull($entry); + $this->assertNotEmpty($entry->getMsgStrPlurals()); + $this->assertEquals( + array( + '%s entrada no actualizada,alguien la está editando.', + '%s entradas no actualizadas,alguien las está editando.', + ), + $entry->getMsgStrPlurals() + ); + } + + public function testEmptyPlurals() + { + $catalog = $this->parseFile('plurals.po'); + + $entry = $catalog->getEntry('Light'); + $this->assertNotNull($entry); + $this->assertNull($entry->getMsgIdPlural()); + $this->assertEmpty($entry->getMsgStrPlurals()); + } + + public function testFlags() + { + $catalog = $this->parseFile('multiflags.po'); + + $this->assertCount(1, $catalog->getEntries()); + $entry = $catalog->getEntry('Attachment', 'Background Attachment'); + + $this->assertNotNull($entry); + $this->assertCount(2, $entry->getFlags()); + $this->assertEquals(array('php-format', 'fuzzy'), $entry->getFlags()); + } + + public function testTranslatorComment() + { + $catalog = $this->parseFile('translatorComments.po'); + $entry = $catalog->getEntry('string.1'); + + $this->assertNotNull($entry); + $this->assertEquals( + array('translator comment', 'second translator comment'), + $entry->getTranslatorComments() + ); + } + + public function testDeveloperComment() + { + $catalog = $this->parseFile('codeComments.po'); + $entry = $catalog->getEntry('string.1'); + + $this->assertNotNull($entry); + $this->assertEquals(array('code comment', 'code translator comment'), $entry->getDeveloperComments()); + } + + public function testReferences() + { + $catalog = $this->parseFile('basicReference.po'); + + $entry = $catalog->getEntry('string.1'); + $this->assertNotNull($entry); + $this->assertEquals(array('src/views/forms.php:44'), $entry->getReference()); + } + + public function testPreviousString() + { + $catalog = $this->parseFile('previousString.po'); + + $this->assertCount(1, $catalog->getEntries()); + + $entry = new Entry('this is a string', 'this is a translation'); + $entry->setPreviousEntry(new Entry('this is a previous string', 'this is a previous translation string')); + $this->assertEquals( + $entry, + $catalog->getEntry('this is a string') + ); + } + + public function testPreviousStringMultiline() + { + $catalog = $this->parseFile('previousStringMultiline.po'); + + $entry = $catalog->getEntry('this is a string'); + $this->assertNotNull($entry); + + $previous = $entry->getPreviousEntry(); + $this->assertNotNull($previous); + $this->assertEquals('this is a previous string', $previous->getMsgId()); + $this->assertEquals('Doloribus nulla odit et aut est. Rerum molestiae pariatur suscipit unde in quidem alias alias. Ut ea omnis placeat rerum quae asperiores. Et recusandae praesentium ea.', $previous->getMsgStr()); + } + + public function testHeaders() + { + $catalog = $this->parseFile('basicHeader.po'); + $this->assertCount(1, $catalog->getEntries()); + } + + public function testOnlyCustomHeaders() + { + $catalog = $this->parseFile('basicCustomHeaders.po'); + $this->assertCount(1, $catalog->getEntries()); + $this->assertGreaterThanOrEqual(1, count($catalog->getHeaders())); + } + + public function testHeadersMultiline() + { + $catalog = $this->parseFile('basicHeadersMultiline.po'); + $this->assertCount(1, $catalog->getEntries()); + $this->assertCount(3,$catalog->getHeaders()); + } + + public function testFileWithOnlyHeaders() + { + $catalog = $this->parseFile('basicOnlyHeader.po'); + $this->assertCount(0, $catalog->getEntries()); + $this->assertGreaterThanOrEqual(1, count($catalog->getHeaders())); + } + + public function testNoBlankLinesSeparatingEntries() + { + $catalog = $this->parseFile('noblankline.po'); + + $this->assertCount(2, $catalog->getEntries()); + } + + public function testProperQuotesEscaping() + { + $catalog = $this->parseFile('quotes.po'); + + $this->assertCount(2, $catalog->getEntries()); + $this->assertNotNull($catalog->getEntry('a\"b\"c')); + $this->assertNotNull($catalog->getEntry('a\nb\nc')); + } +} diff --git a/vendor/sepia/po-parser/tests/WriteTest.php b/vendor/sepia/po-parser/tests/WriteTest.php new file mode 100644 index 00000000..c0d9adb0 --- /dev/null +++ b/vendor/sepia/po-parser/tests/WriteTest.php @@ -0,0 +1,171 @@ + 'string.1', + 'msgstr' => 'translation.1', + 'msgctxt' => 'context.1', + 'reference' => array('src/views/forms.php:44'), + 'tcomment' => array('translator comment'), + 'ccomment' => array('code comment'), + 'flags' => array('1', '2', '3') + )); + $previousEntry = EntryFactory::createFromArray(array( + 'msgid' => 'previous.string.1', + 'msgctxt' => 'previous.context.1' + )); + $entry->setPreviousEntry($previousEntry); + $catalogSource->addEntry($entry); + + // Obsolete entry + $entry = EntryFactory::createFromArray(array( + 'msgid' => 'obsolete.1', + 'msgstr' => $faker->paragraph(5), + 'msgctxt' => 'obsolete.context', + 'obsolete' => true + )); + $catalogSource->addEntry($entry); + + $this->saveCatalog($catalogSource); + + $catalog = $this->parseFile('temp.po'); + $this->assertPoFile($catalogSource, $catalog); + } + + public function testWritePlurals() + { + $catalogSource = new CatalogArray(); + // Normal Entry + $entry = EntryFactory::createFromArray(array( + 'msgid' => 'string.1', + 'msgstr' => 'translation.1', + 'msgstr[0]' => 'translation.plural.0', + 'msgstr[1]' => 'translation.plural.1', + 'msgstr[2]' => 'translation.plural.2', + 'reference' => array('src/views/forms.php:44'), + 'tcomment' => array('translator comment'), + 'ccomment' => array('code comment'), + 'flags' => array('1', '2', '3') + )); + + $catalogSource->addEntry($entry); + + $this->saveCatalog($catalogSource); + $catalog = $this->parseFile('temp.po'); + $entry = $catalog->getEntry('string.1'); + $this->assertCount(3, $entry->getMsgStrPlurals()); + } + + public function testWriteMultibyte() + { + // Make sure that encoding is set to UTF-8 for this test + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + + $catalogSource = new CatalogArray(); + // Normal Entry + $entry = EntryFactory::createFromArray(array( + 'msgid' => 'string.1', + 'msgstr' => 'multibyte.translátion.1' + )); + + $catalogSource->addEntry($entry); + + $this->saveCatalog($catalogSource, 17); + $catalog = $this->parseFile('temp.po'); + $entry = $catalog->getEntry('string.1'); + $this->assertEquals('multibyte.translátion.1', $entry->getMsgStr()); + + // Actual lines in PO file should not be split on multibyte character + $fh = fopen($this->resourcesPath . 'temp.po', 'r'); + fgets($fh); // ignore line 1 + fgets($fh); // ignore line 2 + $this->assertEquals("\"multibyte.translá\"\n", fgets($fh)); + $this->assertEquals("\"tion.1\"\n", fgets($fh)); + + // Revert encoding to previous setting + mb_internal_encoding($mbEncoding); + } + + public function testDoubleEscaped() + { + $catalogSource = new CatalogArray(); + // Normal Entry + $entry = EntryFactory::createFromArray(array( + 'msgid' => 'a\"b\"c', + 'msgstr' => 'quotes' + )); + $catalogSource->addEntry($entry); + + $entry = EntryFactory::createFromArray(array( + 'msgid' => 'a\nb\nc', + 'msgstr' => "linebreaks" + )); + $catalogSource->addEntry($entry); + + $this->saveCatalog($catalogSource); + + $catalog = $this->parseFile('temp.po'); + $this->assertCount(2, $catalog->getEntries()); + $this->assertNotNull($catalog->getEntry('a\"b\"c')); + $this->assertNotNull($catalog->getEntry('a\nb\nc')); + } + + /** + * @throws \Exception + */ + protected function saveCatalog(Catalog $catalog, $wrappingColumn = 80) + { + $fileHandler = new FileSystem($this->resourcesPath.'temp.po'); + $compiler = new PoCompiler($wrappingColumn); + $fileHandler->save($compiler->compile($catalog)); + } + + private function assertPoFile(CatalogArray $catalogSource, Catalog $catalogNew) + { + foreach ($catalogSource->getEntries() as $entry) { + $entryWritten = $catalogNew->getEntry($entry->getMsgId(), $entry->getMsgCtxt()); + + $this->assertNotNull($entryWritten, 'Entry not found:'.$entry->getMsgId().','.$entry->getMsgCtxt()); + + $this->assertEquals($entry->getMsgStr(), $entryWritten->getMsgStr()); + $this->assertEquals($entry->getMsgCtxt(), $entryWritten->getMsgCtxt()); + $this->assertEquals($entry->getFlags(), $entryWritten->getFlags()); + $this->assertEquals($entry->isObsolete(), $entryWritten->isObsolete()); + + if ($entry->isObsolete() === true) { + $this->assertEmpty($entryWritten->getReference()); + $this->assertEmpty($entryWritten->getTranslatorComments()); + $this->assertEmpty($entryWritten->getDeveloperComments()); + } else { + $this->assertEquals($entry->getReference(), $entryWritten->getReference()); + $this->assertEquals($entry->getDeveloperComments(), $entryWritten->getDeveloperComments()); + $this->assertEquals($entry->getTranslatorComments(), $entryWritten->getTranslatorComments()); + } + } + } + + public function tearDown() + { + parent::tearDown(); + + if (file_exists($this->resourcesPath.'temp.po')) { + // unlink($this->resourcesPath.'temp.po'); + } + } +} diff --git a/vendor/sepia/po-parser/tests/pofiles/context.po b/vendor/sepia/po-parser/tests/pofiles/context.po new file mode 100644 index 00000000..f3d80a27 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/context.po @@ -0,0 +1,62 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-25 15:55+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Raúl Ferràs \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" + +#: wp-admin/custom-background.php:305 +msgctxt "Background Attachment" +msgid "Attachment" +msgstr "Adjunto" + +#: wp-admin/includes/schema.php:369 +msgctxt "start of week" +msgid "1" +msgstr "1" + +msgid "1" +msgstr "1" + +#: wp-admin/includes/screen.php:956 +msgctxt "Welcome panel" +msgid "Welcome" +msgstr "Hola" + +#: wp-admin/includes/schema.php:355 +msgctxt "default GMT offset or timezone string" +msgid "0" +msgstr "0" + +#: wp-admin/includes/template.php:662 +#, fuzzy +msgid "%1$s-%2$s" +msgstr "%1$s-%2$s" + +#: wp-admin/custom-header.php:506 +msgid "Images should be at least %1$d pixels wide." +msgstr "Las imágenes deben ser de al menos %1$d pixels de ancho." + +#: wp-admin/custom-header.php:515 +msgid "Suggested height is %1$d pixels." +msgstr "La altura sugerida es de %1$d pixels." + +#: wp-admin/custom-header.php:509 +msgid "Images should be at least %1$d pixels tall." +msgstr "Las imágenes deben ser de al menos %1$d pixels de altura." + +#: wp-admin/install.php:177 +msgctxt "Howdy" +msgid "Welcome" +msgstr "Hola" diff --git a/vendor/sepia/po-parser/tests/pofiles/flags-phpformat-fuzzy.po b/vendor/sepia/po-parser/tests/pofiles/flags-phpformat-fuzzy.po new file mode 100644 index 00000000..7ec702e1 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/flags-phpformat-fuzzy.po @@ -0,0 +1,23 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-25 15:55+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Raúl Ferràs \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" + +#: wp-admin/custom-background.php:305 +#, php-format, fuzzy +msgctxt "Background Attachment" +msgid "Attachment" +msgstr "Adjunto" diff --git a/vendor/sepia/po-parser/tests/pofiles/flags-phpformat.po b/vendor/sepia/po-parser/tests/pofiles/flags-phpformat.po new file mode 100644 index 00000000..ef08f63c --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/flags-phpformat.po @@ -0,0 +1,23 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-25 15:55+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Raúl Ferràs \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" + +#: wp-admin/custom-background.php:305 +#, php-format +msgctxt "Background Attachment" +msgid "Attachment" +msgstr "Adjunto" diff --git a/vendor/sepia/po-parser/tests/pofiles/healthy.po b/vendor/sepia/po-parser/tests/pofiles/healthy.po new file mode 100644 index 00000000..5ef90253 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/healthy.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-25 15:55+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Raúl Ferràs \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ../..\n" +"X-Poedit-SearchPath-2: ../../../modules\n" + +#: ../../classes/dddddd.php:33 +msgid "string.1" +msgstr "translation.1" + +# Translator comment +#. Code comment +#: ../../classes/xxxxx.php:96 ../../classes/controller/iiiiiii.php:107 +#: ../../classes/controller/yyyyyyy/zzzzzz.php:288 +msgid "string.2" +msgstr "Has d'indicar un nom." + + +#| msgid "%d php-файло" +#| msgid_plural "%d php-файлины" +msgid "%d php-файл" +msgid_plural "%d php-файлов" +msgstr "translation" diff --git a/vendor/sepia/po-parser/tests/pofiles/multilines.po b/vendor/sepia/po-parser/tests/pofiles/multilines.po new file mode 100644 index 00000000..e9585735 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/multilines.po @@ -0,0 +1,78 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-09-25 15:55+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Raúl Ferràs \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_t\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-Basepath: .\n" +"X-Generator: Poedit 1.5.7\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ../..\n" +"X-Poedit-SearchPath-2: ../../../modules\n" + +# @ default +#: ../../classes/dddddd.php:33 +msgid "Lo sentimos, ha ocurrido un error..." +msgstr "Ho sentim, s'ha produït un error" + +#: ../../classes/xxxxx.php:96 ../../classes/controller/iiiiiii.php:107 +#: ../../classes/controller/yyyyyyy/zzzzzz.php:288 +msgid "Debes indicar un nombre." +msgstr "Has d'indicar un nom." + +#: ../../classes/ccccc.php:100 ../../classes/cccc.php:104 +#: ../../classes/controller/cccc/mmmmm.php:295 +#: ../../classes/controller/cccc/mmmmm.php:513 +msgid "Ya existe otro usuario con este mismo nombre." +msgstr "Ja existeix un altre usuari amb aquest nom." + +#: ../../classes/ccccc.php:108 ../../classes/controller/cccc/mmmmm.php:305 +#: ../../classes/controller/ccccc/mmmmm.php:518 +msgid "Debes indicar una dirección web!" +msgstr "Has d'indicar una direcció web!" + +# @ default +#: ../../classes/uuuuuuu.php:175 +#, fuzzy +msgid "El archivo supera el tamaño máximo permitido: %size%MB" +msgstr "" +"El fitxer {file} es massa gran, el tamany máxim de fitxer es {sizeLimit}." + +#: ../../classes/controller/ccccc.php:361 +msgid "" +"%user% acaba de responder tu comentario.
    Consulta que te ha " +"dicho %link%aquí." +msgstr "" +"%user% acaba de respondre el teu comentari.
    Consulta que t'ha " +"dit %link%aquí." + +#: ../../classes/controller/eeee.php:786 +msgid "" +"Atención, para finalizar el proceso debes iniciar sesión con tu usuario " +".
    No sufras, hemos guardado los datos introducidos, una vez " +"te autentifiques te redirigiremos al paso final." +msgstr "" +"Atenció, per finalitzar el procés has de iniciar sessió amb el teu usuari " +".
    No pateixis, hem desat les teves dades, un cop " +"t'autentifiquis finalitzarem el procés." + +# @ default +#~ msgid "Arrastra imagenes aquí para subirlas." +#~ msgstr "Arrossega les teves imatges aquí per pujarles." + +# @ default +#~ msgid "" +#~ "El archivo {file} es demasiado pequeño, el tamaño mínimo de archivo es " +#~ "{minSizeLimit}." +#~ msgstr "" +#~ "El fitxer {file} es massa petit, el tamany mínim de fitxer es " +#~ "{minSizeLimit}." diff --git a/vendor/sepia/po-parser/tests/pofiles/noheader.po b/vendor/sepia/po-parser/tests/pofiles/noheader.po new file mode 100644 index 00000000..92606f01 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/noheader.po @@ -0,0 +1,23 @@ +#: tmp/cache/00/78/1d67cd3f64c5469c21cb05e6fd0a.php:32 +#: tmp/cache/07/0a/9136032d279c7c9bb536e108fced.php:58 +#: tmp/cache/0b/da/a019bff51aa8a932ec179398dc43.php:65 +#: tmp/cache/18/41/43e62ed075451a77574351278bf2.php:58 +#: tmp/cache/1d/81/2af439d1ee9aac469ff66b2173d0.php:58 +#: tmp/cache/32/46/d22400dcca2bfe7f4e4afd39fd01.php:65 +#: tmp/cache/32/da/138149be12bf58b7fa8b621abcf4.php:35 +#: tmp/cache/35/77/88dcd5f3a90a7842ea85959569c9.php:58 +#: tmp/cache/69/1c/68c94bb5f661f65ef796afc069a9.php:58 +#: tmp/cache/95/14/b34e21f518a52d77109ed535cb5f.php:59 +#: tmp/cache/9e/6d/48f3a91d014c76613583be955d63.php:58 +#: tmp/cache/ac/e0/356f9dc6499cc1b18453093a79f3.php:58 +#: tmp/cache/b1/10/16e1bfb77387f1ca7d0ff4c67a64.php:57 +#: tmp/cache/fe/91/b339a580bcf69b609d15988a1b42.php:58 +msgid "Membership" +msgstr "" + +#: tmp/cache/00/78/1d67cd3f64c5469c21cb05e6fd0a.php:45 +#: tmp/cache/18/05/1489b493d73a1596584807221eb9.php:40 +#: tmp/cache/27/73/8503d0d9f20aabc08a6372c67dba.php:49 +#: tmp/cache/7a/e7/9b68911bacf2b1ef75790f07bff8.php:23 +msgid "New membership type" +msgstr "" diff --git a/vendor/sepia/po-parser/tests/pofiles/pluralsMultiline.po b/vendor/sepia/po-parser/tests/pofiles/pluralsMultiline.po new file mode 100644 index 00000000..2ac59402 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/pluralsMultiline.po @@ -0,0 +1,33 @@ +# Translation of Administration in Spanish (Spain) +# This file is distributed under the same license as the Administration package. +msgid "" +msgstr "" +"PO-Revision-Date: 2013-10-23 09:51:48+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/0.1\n" +"Project-Id-Version: Administration\n" + + +#: wp-admin/edit.php:238 +msgid "%s post not updated," +"somebody is editing it." +msgid_plural "%s posts not updated," +"somebody is editing them." +msgstr[0] "%s entrada no actualizada," +"alguien la está editando." +msgstr[1] "%s entradas no actualizadas," +"alguien las está editando." + +#: wp-admin/edit.php:239 +msgid "" +"%s post permanently deleted." +msgid_plural "%s posts permanently deleted." +msgstr[0] "" +"%s entrada borrada" +"permanentemente." +msgstr[1] "" +"%s entradas borradas" +"permanentemente." diff --git a/vendor/sepia/po-parser/tests/pofiles/previous_unstranslated.po b/vendor/sepia/po-parser/tests/pofiles/previous_unstranslated.po new file mode 100644 index 00000000..b7373428 --- /dev/null +++ b/vendor/sepia/po-parser/tests/pofiles/previous_unstranslated.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: volga-volga.local\n" +"Report-Msgid-Bugs-To: pm@101media.ru\n" +"POT-Creation-Date: 2014-07-08 07:51+0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#| msgid "this is a previous string" +#| msgstr "this is a previous translation string" +msgid "this is a string" +msgstr "this is a translation" + diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE new file mode 100644 index 00000000..24fa32c2 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2018 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php new file mode 100644 index 00000000..a5e4a8fd --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -0,0 +1,800 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Mbstring; + +/** + * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. + * + * Implemented: + * - mb_chr - Returns a specific character from its Unicode code point + * - mb_convert_encoding - Convert character encoding + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_mimeheader - Decode string in MIME header field + * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding + * - mb_internal_encoding - Set/Get internal character encoding + * - mb_list_encodings - Returns an array of all supported encodings + * - mb_ord - Returns the Unicode code point of a character + * - mb_output_handler - Callback function converts character encoding in output buffer + * - mb_scrub - Replaces ill-formed byte sequences with substitute characters + * - mb_strlen - Get string length + * - mb_strpos - Find position of first occurrence of string in a string + * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_strtolower - Make a string lowercase + * - mb_strtoupper - Make a string uppercase + * - mb_substitute_character - Set/Get substitution character + * - mb_substr - Get part of string + * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive + * - mb_stristr - Finds first occurrence of a string within another, case insensitive + * - mb_strrchr - Finds the last occurrence of a character in a string within another + * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive + * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive + * - mb_strstr - Finds first occurrence of a string within another + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences + * + * Not implemented: + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width + * + * @author Nicolas Grekas + * + * @internal + */ +final class Mbstring +{ + const MB_CASE_FOLD = PHP_INT_MAX; + + private static $encodingList = array('ASCII', 'UTF-8'); + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + private static $caseFold = array( + array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), + array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'), + ); + + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) + { + if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); + } else { + $fromEncoding = self::getEncoding($fromEncoding); + } + + $toEncoding = self::getEncoding($toEncoding); + + if ('BASE64' === $fromEncoding) { + $s = base64_decode($s); + $fromEncoding = $toEncoding; + } + + if ('BASE64' === $toEncoding) { + return base64_encode($s); + } + + if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { + if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { + $fromEncoding = 'Windows-1252'; + } + if ('UTF-8' !== $fromEncoding) { + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); + } + + return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s); + } + + if ('HTML-ENTITIES' === $fromEncoding) { + $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); + $fromEncoding = 'UTF-8'; + } + + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + } + + public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) + { + $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); + + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + }); + + return $ok ? $fromEncoding : false; + } + + public static function mb_decode_mimeheader($s) + { + return iconv_mime_decode($s, 2, self::$internalEncoding); + } + + public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) + { + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); + } + + public static function mb_decode_numericentity($s, $convmap, $encoding = null) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || !$convmap) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return ''; // Instead of null (cf. mb_encode_numericentity). + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(\count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return Mbstring::mb_chr($c - $convmap[$i + 2]); + } + } + + return $m[0]; + }, $s); + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || !$convmap) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return null; // Instead of '' (cf. mb_decode_numericentity). + } + + if (null !== $is_hex && !\is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', E_USER_WARNING); + + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + + $cnt = floor(\count($convmap) / 4) * 4; + $i = 0; + $len = \strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + if (MB_CASE_TITLE == $mode) { + static $titleRegexp = null; + if (null === $titleRegexp) { + $titleRegexp = self::getData('titleCaseRegexp'); + } + $s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s); + } else { + if (MB_CASE_UPPER == $mode) { + static $upper = null; + if (null === $upper) { + $upper = self::getData('upperCase'); + } + $map = $upper; + } else { + if (self::MB_CASE_FOLD === $mode) { + $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); + } + + static $lower = null; + if (null === $lower) { + $lower = self::getData('lowerCase'); + } + $map = $lower; + } + + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if (isset($map[$uchr])) { + $uchr = $map[$uchr]; + $nlen = \strlen($uchr); + + if ($nlen == $ulen) { + $nlen = $i; + do { + $s[--$nlen] = $uchr[--$ulen]; + } while ($ulen); + } else { + $s = substr_replace($s, $uchr, $i - $ulen, $ulen); + $len += $nlen - $ulen; + $i += $nlen - $ulen; + } + } + } + } + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_internal_encoding($encoding = null) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) { + self::$internalEncoding = $encoding; + + return true; + } + + return false; + } + + public static function mb_language($lang = null) + { + if (null === $lang) { + return self::$language; + } + + switch ($lang = strtolower($lang)) { + case 'uni': + case 'neutral': + self::$language = $lang; + + return true; + } + + return false; + } + + public static function mb_list_encodings() + { + return array('UTF-8'); + } + + public static function mb_encoding_aliases($encoding) + { + switch (strtoupper($encoding)) { + case 'UTF8': + case 'UTF-8': + return array('utf8'); + } + + return false; + } + + public static function mb_check_encoding($var = null, $encoding = null) + { + if (null === $encoding) { + if (null === $var) { + return false; + } + $encoding = self::$internalEncoding; + } + + return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); + } + + public static function mb_detect_encoding($str, $encodingList = null, $strict = false) + { + if (null === $encodingList) { + $encodingList = self::$encodingList; + } else { + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + } + + foreach ($encodingList as $enc) { + switch ($enc) { + case 'ASCII': + if (!preg_match('/[\x80-\xFF]/', $str)) { + return $enc; + } + break; + + case 'UTF8': + case 'UTF-8': + if (preg_match('//u', $str)) { + return 'UTF-8'; + } + break; + + default: + if (0 === strncmp($enc, 'ISO-8859-', 9)) { + return $enc; + } + } + } + + return false; + } + + public static function mb_detect_order($encodingList = null) + { + if (null === $encodingList) { + return self::$encodingList; + } + + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + + foreach ($encodingList as $enc) { + switch ($enc) { + default: + if (strncmp($enc, 'ISO-8859-', 9)) { + return false; + } + // no break + case 'ASCII': + case 'UTF8': + case 'UTF-8': + } + } + + self::$encodingList = $encodingList; + + return true; + } + + public static function mb_strlen($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return \strlen($s); + } + + return @iconv_strlen($s, $encoding); + } + + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } + + $needle = (string) $needle; + if ('' === $needle) { + trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); + + return false; + } + + return iconv_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } + + if ($offset != (int) $offset) { + $offset = 0; + } elseif ($offset = (int) $offset) { + if ($offset < 0) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + $offset = 0; + } else { + $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); + } + } + + $pos = iconv_strrpos($haystack, $needle, $encoding); + + return false !== $pos ? $offset + $pos : false; + } + + public static function mb_strtolower($s, $encoding = null) + { + return self::mb_convert_case($s, MB_CASE_LOWER, $encoding); + } + + public static function mb_strtoupper($s, $encoding = null) + { + return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); + } + + public static function mb_substitute_character($c = null) + { + if (0 === strcasecmp($c, 'none')) { + return true; + } + + return null !== $c ? false : 'none'; + } + + public static function mb_substr($s, $start, $length = null, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return substr($s, $start, null === $length ? 2147483647 : $length); + } + + if ($start < 0) { + $start = iconv_strlen($s, $encoding) + $start; + if ($start < 0) { + $start = 0; + } + } + + if (null === $length) { + $length = 2147483647; + } elseif ($length < 0) { + $length = iconv_strlen($s, $encoding) + $length - $start; + if ($length < 0) { + return ''; + } + } + + return (string) iconv_substr($s, $start, $length, $encoding); + } + + public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); + $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + + return self::mb_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) + { + $pos = self::mb_stripos($haystack, $needle, 0, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrchr($haystack, $needle, $part); + } + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) + { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = self::mb_strripos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); + $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + + return self::mb_strrpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) + { + $pos = strpos($haystack, $needle); + if (false === $pos) { + return false; + } + if ($part) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + public static function mb_get_info($type = 'all') + { + $info = array( + 'internal_encoding' => self::$internalEncoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encodingList, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ); + + if ('all' === $type) { + return $info; + } + if (isset($info[$type])) { + return $info[$type]; + } + + return false; + } + + public static function mb_http_input($type = '') + { + return false; + } + + public static function mb_http_output($encoding = null) + { + return null !== $encoding ? 'pass' === $encoding : 'pass'; + } + + public static function mb_strwidth($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + + if ('UTF-8' !== $encoding) { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); + } + + public static function mb_substr_count($haystack, $needle, $encoding = null) + { + return substr_count($haystack, $needle); + } + + public static function mb_output_handler($contents, $status) + { + return $contents; + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } + + private static function getSubpart($pos, $part, $haystack, $encoding) + { + if (false === $pos) { + return false; + } + if ($part) { + return self::mb_substr($haystack, 0, $pos, $encoding); + } + + return self::mb_substr($haystack, $pos, null, $encoding); + } + + private static function html_encoding_callback(array $m) + { + $i = 1; + $entities = ''; + $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); + + while (isset($m[$i])) { + if (0x80 > $m[$i]) { + $entities .= \chr($m[$i++]); + continue; + } + if (0xF0 <= $m[$i]) { + $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } elseif (0xE0 <= $m[$i]) { + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } else { + $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; + } + + $entities .= '&#'.$c.';'; + } + + return $entities; + } + + private static function title_case(array $s) + { + return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } + + private static function getEncoding($encoding) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $encoding = strtoupper($encoding); + + if ('8BIT' === $encoding || 'BINARY' === $encoding) { + return 'CP850'; + } + if ('UTF8' === $encoding) { + return 'UTF-8'; + } + + return $encoding; + } +} diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md new file mode 100644 index 00000000..342e8286 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/README.md @@ -0,0 +1,13 @@ +Symfony Polyfill / Mbstring +=========================== + +This component provides a partial, native PHP implementation for the +[Mbstring](http://php.net/mbstring) extension. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php new file mode 100644 index 00000000..e6fbfa64 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -0,0 +1,1096 @@ + 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + 'À' => 'à', + 'Á' => 'á', + 'Â' => 'â', + 'Ã' => 'ã', + 'Ä' => 'ä', + 'Å' => 'å', + 'Æ' => 'æ', + 'Ç' => 'ç', + 'È' => 'è', + 'É' => 'é', + 'Ê' => 'ê', + 'Ë' => 'ë', + 'Ì' => 'ì', + 'Í' => 'í', + 'Î' => 'î', + 'Ï' => 'ï', + 'Ð' => 'ð', + 'Ñ' => 'ñ', + 'Ò' => 'ò', + 'Ó' => 'ó', + 'Ô' => 'ô', + 'Õ' => 'õ', + 'Ö' => 'ö', + 'Ø' => 'ø', + 'Ù' => 'ù', + 'Ú' => 'ú', + 'Û' => 'û', + 'Ü' => 'ü', + 'Ý' => 'ý', + 'Þ' => 'þ', + 'Ā' => 'ā', + 'Ă' => 'ă', + 'Ą' => 'ą', + 'Ć' => 'ć', + 'Ĉ' => 'ĉ', + 'Ċ' => 'ċ', + 'Č' => 'č', + 'Ď' => 'ď', + 'Đ' => 'đ', + 'Ē' => 'ē', + 'Ĕ' => 'ĕ', + 'Ė' => 'ė', + 'Ę' => 'ę', + 'Ě' => 'ě', + 'Ĝ' => 'ĝ', + 'Ğ' => 'ğ', + 'Ġ' => 'ġ', + 'Ģ' => 'ģ', + 'Ĥ' => 'ĥ', + 'Ħ' => 'ħ', + 'Ĩ' => 'ĩ', + 'Ī' => 'ī', + 'Ĭ' => 'ĭ', + 'Į' => 'į', + 'İ' => 'i', + 'IJ' => 'ij', + 'Ĵ' => 'ĵ', + 'Ķ' => 'ķ', + 'Ĺ' => 'ĺ', + 'Ļ' => 'ļ', + 'Ľ' => 'ľ', + 'Ŀ' => 'ŀ', + 'Ł' => 'ł', + 'Ń' => 'ń', + 'Ņ' => 'ņ', + 'Ň' => 'ň', + 'Ŋ' => 'ŋ', + 'Ō' => 'ō', + 'Ŏ' => 'ŏ', + 'Ő' => 'ő', + 'Œ' => 'œ', + 'Ŕ' => 'ŕ', + 'Ŗ' => 'ŗ', + 'Ř' => 'ř', + 'Ś' => 'ś', + 'Ŝ' => 'ŝ', + 'Ş' => 'ş', + 'Š' => 'š', + 'Ţ' => 'ţ', + 'Ť' => 'ť', + 'Ŧ' => 'ŧ', + 'Ũ' => 'ũ', + 'Ū' => 'ū', + 'Ŭ' => 'ŭ', + 'Ů' => 'ů', + 'Ű' => 'ű', + 'Ų' => 'ų', + 'Ŵ' => 'ŵ', + 'Ŷ' => 'ŷ', + 'Ÿ' => 'ÿ', + 'Ź' => 'ź', + 'Ż' => 'ż', + 'Ž' => 'ž', + 'Ɓ' => 'ɓ', + 'Ƃ' => 'ƃ', + 'Ƅ' => 'ƅ', + 'Ɔ' => 'ɔ', + 'Ƈ' => 'ƈ', + 'Ɖ' => 'ɖ', + 'Ɗ' => 'ɗ', + 'Ƌ' => 'ƌ', + 'Ǝ' => 'ǝ', + 'Ə' => 'ə', + 'Ɛ' => 'ɛ', + 'Ƒ' => 'ƒ', + 'Ɠ' => 'ɠ', + 'Ɣ' => 'ɣ', + 'Ɩ' => 'ɩ', + 'Ɨ' => 'ɨ', + 'Ƙ' => 'ƙ', + 'Ɯ' => 'ɯ', + 'Ɲ' => 'ɲ', + 'Ɵ' => 'ɵ', + 'Ơ' => 'ơ', + 'Ƣ' => 'ƣ', + 'Ƥ' => 'ƥ', + 'Ʀ' => 'ʀ', + 'Ƨ' => 'ƨ', + 'Ʃ' => 'ʃ', + 'Ƭ' => 'ƭ', + 'Ʈ' => 'ʈ', + 'Ư' => 'ư', + 'Ʊ' => 'ʊ', + 'Ʋ' => 'ʋ', + 'Ƴ' => 'ƴ', + 'Ƶ' => 'ƶ', + 'Ʒ' => 'ʒ', + 'Ƹ' => 'ƹ', + 'Ƽ' => 'ƽ', + 'DŽ' => 'dž', + 'Dž' => 'dž', + 'LJ' => 'lj', + 'Lj' => 'lj', + 'NJ' => 'nj', + 'Nj' => 'nj', + 'Ǎ' => 'ǎ', + 'Ǐ' => 'ǐ', + 'Ǒ' => 'ǒ', + 'Ǔ' => 'ǔ', + 'Ǖ' => 'ǖ', + 'Ǘ' => 'ǘ', + 'Ǚ' => 'ǚ', + 'Ǜ' => 'ǜ', + 'Ǟ' => 'ǟ', + 'Ǡ' => 'ǡ', + 'Ǣ' => 'ǣ', + 'Ǥ' => 'ǥ', + 'Ǧ' => 'ǧ', + 'Ǩ' => 'ǩ', + 'Ǫ' => 'ǫ', + 'Ǭ' => 'ǭ', + 'Ǯ' => 'ǯ', + 'DZ' => 'dz', + 'Dz' => 'dz', + 'Ǵ' => 'ǵ', + 'Ƕ' => 'ƕ', + 'Ƿ' => 'ƿ', + 'Ǹ' => 'ǹ', + 'Ǻ' => 'ǻ', + 'Ǽ' => 'ǽ', + 'Ǿ' => 'ǿ', + 'Ȁ' => 'ȁ', + 'Ȃ' => 'ȃ', + 'Ȅ' => 'ȅ', + 'Ȇ' => 'ȇ', + 'Ȉ' => 'ȉ', + 'Ȋ' => 'ȋ', + 'Ȍ' => 'ȍ', + 'Ȏ' => 'ȏ', + 'Ȑ' => 'ȑ', + 'Ȓ' => 'ȓ', + 'Ȕ' => 'ȕ', + 'Ȗ' => 'ȗ', + 'Ș' => 'ș', + 'Ț' => 'ț', + 'Ȝ' => 'ȝ', + 'Ȟ' => 'ȟ', + 'Ƞ' => 'ƞ', + 'Ȣ' => 'ȣ', + 'Ȥ' => 'ȥ', + 'Ȧ' => 'ȧ', + 'Ȩ' => 'ȩ', + 'Ȫ' => 'ȫ', + 'Ȭ' => 'ȭ', + 'Ȯ' => 'ȯ', + 'Ȱ' => 'ȱ', + 'Ȳ' => 'ȳ', + 'Ⱥ' => 'ⱥ', + 'Ȼ' => 'ȼ', + 'Ƚ' => 'ƚ', + 'Ⱦ' => 'ⱦ', + 'Ɂ' => 'ɂ', + 'Ƀ' => 'ƀ', + 'Ʉ' => 'ʉ', + 'Ʌ' => 'ʌ', + 'Ɇ' => 'ɇ', + 'Ɉ' => 'ɉ', + 'Ɋ' => 'ɋ', + 'Ɍ' => 'ɍ', + 'Ɏ' => 'ɏ', + 'Ͱ' => 'ͱ', + 'Ͳ' => 'ͳ', + 'Ͷ' => 'ͷ', + 'Ϳ' => 'ϳ', + 'Ά' => 'ά', + 'Έ' => 'έ', + 'Ή' => 'ή', + 'Ί' => 'ί', + 'Ό' => 'ό', + 'Ύ' => 'ύ', + 'Ώ' => 'ώ', + 'Α' => 'α', + 'Β' => 'β', + 'Γ' => 'γ', + 'Δ' => 'δ', + 'Ε' => 'ε', + 'Ζ' => 'ζ', + 'Η' => 'η', + 'Θ' => 'θ', + 'Ι' => 'ι', + 'Κ' => 'κ', + 'Λ' => 'λ', + 'Μ' => 'μ', + 'Ν' => 'ν', + 'Ξ' => 'ξ', + 'Ο' => 'ο', + 'Π' => 'π', + 'Ρ' => 'ρ', + 'Σ' => 'σ', + 'Τ' => 'τ', + 'Υ' => 'υ', + 'Φ' => 'φ', + 'Χ' => 'χ', + 'Ψ' => 'ψ', + 'Ω' => 'ω', + 'Ϊ' => 'ϊ', + 'Ϋ' => 'ϋ', + 'Ϗ' => 'ϗ', + 'Ϙ' => 'ϙ', + 'Ϛ' => 'ϛ', + 'Ϝ' => 'ϝ', + 'Ϟ' => 'ϟ', + 'Ϡ' => 'ϡ', + 'Ϣ' => 'ϣ', + 'Ϥ' => 'ϥ', + 'Ϧ' => 'ϧ', + 'Ϩ' => 'ϩ', + 'Ϫ' => 'ϫ', + 'Ϭ' => 'ϭ', + 'Ϯ' => 'ϯ', + 'ϴ' => 'θ', + 'Ϸ' => 'ϸ', + 'Ϲ' => 'ϲ', + 'Ϻ' => 'ϻ', + 'Ͻ' => 'ͻ', + 'Ͼ' => 'ͼ', + 'Ͽ' => 'ͽ', + 'Ѐ' => 'ѐ', + 'Ё' => 'ё', + 'Ђ' => 'ђ', + 'Ѓ' => 'ѓ', + 'Є' => 'є', + 'Ѕ' => 'ѕ', + 'І' => 'і', + 'Ї' => 'ї', + 'Ј' => 'ј', + 'Љ' => 'љ', + 'Њ' => 'њ', + 'Ћ' => 'ћ', + 'Ќ' => 'ќ', + 'Ѝ' => 'ѝ', + 'Ў' => 'ў', + 'Џ' => 'џ', + 'А' => 'а', + 'Б' => 'б', + 'В' => 'в', + 'Г' => 'г', + 'Д' => 'д', + 'Е' => 'е', + 'Ж' => 'ж', + 'З' => 'з', + 'И' => 'и', + 'Й' => 'й', + 'К' => 'к', + 'Л' => 'л', + 'М' => 'м', + 'Н' => 'н', + 'О' => 'о', + 'П' => 'п', + 'Р' => 'р', + 'С' => 'с', + 'Т' => 'т', + 'У' => 'у', + 'Ф' => 'ф', + 'Х' => 'х', + 'Ц' => 'ц', + 'Ч' => 'ч', + 'Ш' => 'ш', + 'Щ' => 'щ', + 'Ъ' => 'ъ', + 'Ы' => 'ы', + 'Ь' => 'ь', + 'Э' => 'э', + 'Ю' => 'ю', + 'Я' => 'я', + 'Ѡ' => 'ѡ', + 'Ѣ' => 'ѣ', + 'Ѥ' => 'ѥ', + 'Ѧ' => 'ѧ', + 'Ѩ' => 'ѩ', + 'Ѫ' => 'ѫ', + 'Ѭ' => 'ѭ', + 'Ѯ' => 'ѯ', + 'Ѱ' => 'ѱ', + 'Ѳ' => 'ѳ', + 'Ѵ' => 'ѵ', + 'Ѷ' => 'ѷ', + 'Ѹ' => 'ѹ', + 'Ѻ' => 'ѻ', + 'Ѽ' => 'ѽ', + 'Ѿ' => 'ѿ', + 'Ҁ' => 'ҁ', + 'Ҋ' => 'ҋ', + 'Ҍ' => 'ҍ', + 'Ҏ' => 'ҏ', + 'Ґ' => 'ґ', + 'Ғ' => 'ғ', + 'Ҕ' => 'ҕ', + 'Җ' => 'җ', + 'Ҙ' => 'ҙ', + 'Қ' => 'қ', + 'Ҝ' => 'ҝ', + 'Ҟ' => 'ҟ', + 'Ҡ' => 'ҡ', + 'Ң' => 'ң', + 'Ҥ' => 'ҥ', + 'Ҧ' => 'ҧ', + 'Ҩ' => 'ҩ', + 'Ҫ' => 'ҫ', + 'Ҭ' => 'ҭ', + 'Ү' => 'ү', + 'Ұ' => 'ұ', + 'Ҳ' => 'ҳ', + 'Ҵ' => 'ҵ', + 'Ҷ' => 'ҷ', + 'Ҹ' => 'ҹ', + 'Һ' => 'һ', + 'Ҽ' => 'ҽ', + 'Ҿ' => 'ҿ', + 'Ӏ' => 'ӏ', + 'Ӂ' => 'ӂ', + 'Ӄ' => 'ӄ', + 'Ӆ' => 'ӆ', + 'Ӈ' => 'ӈ', + 'Ӊ' => 'ӊ', + 'Ӌ' => 'ӌ', + 'Ӎ' => 'ӎ', + 'Ӑ' => 'ӑ', + 'Ӓ' => 'ӓ', + 'Ӕ' => 'ӕ', + 'Ӗ' => 'ӗ', + 'Ә' => 'ә', + 'Ӛ' => 'ӛ', + 'Ӝ' => 'ӝ', + 'Ӟ' => 'ӟ', + 'Ӡ' => 'ӡ', + 'Ӣ' => 'ӣ', + 'Ӥ' => 'ӥ', + 'Ӧ' => 'ӧ', + 'Ө' => 'ө', + 'Ӫ' => 'ӫ', + 'Ӭ' => 'ӭ', + 'Ӯ' => 'ӯ', + 'Ӱ' => 'ӱ', + 'Ӳ' => 'ӳ', + 'Ӵ' => 'ӵ', + 'Ӷ' => 'ӷ', + 'Ӹ' => 'ӹ', + 'Ӻ' => 'ӻ', + 'Ӽ' => 'ӽ', + 'Ӿ' => 'ӿ', + 'Ԁ' => 'ԁ', + 'Ԃ' => 'ԃ', + 'Ԅ' => 'ԅ', + 'Ԇ' => 'ԇ', + 'Ԉ' => 'ԉ', + 'Ԋ' => 'ԋ', + 'Ԍ' => 'ԍ', + 'Ԏ' => 'ԏ', + 'Ԑ' => 'ԑ', + 'Ԓ' => 'ԓ', + 'Ԕ' => 'ԕ', + 'Ԗ' => 'ԗ', + 'Ԙ' => 'ԙ', + 'Ԛ' => 'ԛ', + 'Ԝ' => 'ԝ', + 'Ԟ' => 'ԟ', + 'Ԡ' => 'ԡ', + 'Ԣ' => 'ԣ', + 'Ԥ' => 'ԥ', + 'Ԧ' => 'ԧ', + 'Ԩ' => 'ԩ', + 'Ԫ' => 'ԫ', + 'Ԭ' => 'ԭ', + 'Ԯ' => 'ԯ', + 'Ա' => 'ա', + 'Բ' => 'բ', + 'Գ' => 'գ', + 'Դ' => 'դ', + 'Ե' => 'ե', + 'Զ' => 'զ', + 'Է' => 'է', + 'Ը' => 'ը', + 'Թ' => 'թ', + 'Ժ' => 'ժ', + 'Ի' => 'ի', + 'Լ' => 'լ', + 'Խ' => 'խ', + 'Ծ' => 'ծ', + 'Կ' => 'կ', + 'Հ' => 'հ', + 'Ձ' => 'ձ', + 'Ղ' => 'ղ', + 'Ճ' => 'ճ', + 'Մ' => 'մ', + 'Յ' => 'յ', + 'Ն' => 'ն', + 'Շ' => 'շ', + 'Ո' => 'ո', + 'Չ' => 'չ', + 'Պ' => 'պ', + 'Ջ' => 'ջ', + 'Ռ' => 'ռ', + 'Ս' => 'ս', + 'Վ' => 'վ', + 'Տ' => 'տ', + 'Ր' => 'ր', + 'Ց' => 'ց', + 'Ւ' => 'ւ', + 'Փ' => 'փ', + 'Ք' => 'ք', + 'Օ' => 'օ', + 'Ֆ' => 'ֆ', + 'Ⴀ' => 'ⴀ', + 'Ⴁ' => 'ⴁ', + 'Ⴂ' => 'ⴂ', + 'Ⴃ' => 'ⴃ', + 'Ⴄ' => 'ⴄ', + 'Ⴅ' => 'ⴅ', + 'Ⴆ' => 'ⴆ', + 'Ⴇ' => 'ⴇ', + 'Ⴈ' => 'ⴈ', + 'Ⴉ' => 'ⴉ', + 'Ⴊ' => 'ⴊ', + 'Ⴋ' => 'ⴋ', + 'Ⴌ' => 'ⴌ', + 'Ⴍ' => 'ⴍ', + 'Ⴎ' => 'ⴎ', + 'Ⴏ' => 'ⴏ', + 'Ⴐ' => 'ⴐ', + 'Ⴑ' => 'ⴑ', + 'Ⴒ' => 'ⴒ', + 'Ⴓ' => 'ⴓ', + 'Ⴔ' => 'ⴔ', + 'Ⴕ' => 'ⴕ', + 'Ⴖ' => 'ⴖ', + 'Ⴗ' => 'ⴗ', + 'Ⴘ' => 'ⴘ', + 'Ⴙ' => 'ⴙ', + 'Ⴚ' => 'ⴚ', + 'Ⴛ' => 'ⴛ', + 'Ⴜ' => 'ⴜ', + 'Ⴝ' => 'ⴝ', + 'Ⴞ' => 'ⴞ', + 'Ⴟ' => 'ⴟ', + 'Ⴠ' => 'ⴠ', + 'Ⴡ' => 'ⴡ', + 'Ⴢ' => 'ⴢ', + 'Ⴣ' => 'ⴣ', + 'Ⴤ' => 'ⴤ', + 'Ⴥ' => 'ⴥ', + 'Ⴧ' => 'ⴧ', + 'Ⴭ' => 'ⴭ', + 'Ḁ' => 'ḁ', + 'Ḃ' => 'ḃ', + 'Ḅ' => 'ḅ', + 'Ḇ' => 'ḇ', + 'Ḉ' => 'ḉ', + 'Ḋ' => 'ḋ', + 'Ḍ' => 'ḍ', + 'Ḏ' => 'ḏ', + 'Ḑ' => 'ḑ', + 'Ḓ' => 'ḓ', + 'Ḕ' => 'ḕ', + 'Ḗ' => 'ḗ', + 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', + 'Ḝ' => 'ḝ', + 'Ḟ' => 'ḟ', + 'Ḡ' => 'ḡ', + 'Ḣ' => 'ḣ', + 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', + 'Ḩ' => 'ḩ', + 'Ḫ' => 'ḫ', + 'Ḭ' => 'ḭ', + 'Ḯ' => 'ḯ', + 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', + 'Ḵ' => 'ḵ', + 'Ḷ' => 'ḷ', + 'Ḹ' => 'ḹ', + 'Ḻ' => 'ḻ', + 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', + 'Ṁ' => 'ṁ', + 'Ṃ' => 'ṃ', + 'Ṅ' => 'ṅ', + 'Ṇ' => 'ṇ', + 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', + 'Ṍ' => 'ṍ', + 'Ṏ' => 'ṏ', + 'Ṑ' => 'ṑ', + 'Ṓ' => 'ṓ', + 'Ṕ' => 'ṕ', + 'Ṗ' => 'ṗ', + 'Ṙ' => 'ṙ', + 'Ṛ' => 'ṛ', + 'Ṝ' => 'ṝ', + 'Ṟ' => 'ṟ', + 'Ṡ' => 'ṡ', + 'Ṣ' => 'ṣ', + 'Ṥ' => 'ṥ', + 'Ṧ' => 'ṧ', + 'Ṩ' => 'ṩ', + 'Ṫ' => 'ṫ', + 'Ṭ' => 'ṭ', + 'Ṯ' => 'ṯ', + 'Ṱ' => 'ṱ', + 'Ṳ' => 'ṳ', + 'Ṵ' => 'ṵ', + 'Ṷ' => 'ṷ', + 'Ṹ' => 'ṹ', + 'Ṻ' => 'ṻ', + 'Ṽ' => 'ṽ', + 'Ṿ' => 'ṿ', + 'Ẁ' => 'ẁ', + 'Ẃ' => 'ẃ', + 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', + 'Ẉ' => 'ẉ', + 'Ẋ' => 'ẋ', + 'Ẍ' => 'ẍ', + 'Ẏ' => 'ẏ', + 'Ẑ' => 'ẑ', + 'Ẓ' => 'ẓ', + 'Ẕ' => 'ẕ', + 'ẞ' => 'ß', + 'Ạ' => 'ạ', + 'Ả' => 'ả', + 'Ấ' => 'ấ', + 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', + 'Ẫ' => 'ẫ', + 'Ậ' => 'ậ', + 'Ắ' => 'ắ', + 'Ằ' => 'ằ', + 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', + 'Ặ' => 'ặ', + 'Ẹ' => 'ẹ', + 'Ẻ' => 'ẻ', + 'Ẽ' => 'ẽ', + 'Ế' => 'ế', + 'Ề' => 'ề', + 'Ể' => 'ể', + 'Ễ' => 'ễ', + 'Ệ' => 'ệ', + 'Ỉ' => 'ỉ', + 'Ị' => 'ị', + 'Ọ' => 'ọ', + 'Ỏ' => 'ỏ', + 'Ố' => 'ố', + 'Ồ' => 'ồ', + 'Ổ' => 'ổ', + 'Ỗ' => 'ỗ', + 'Ộ' => 'ộ', + 'Ớ' => 'ớ', + 'Ờ' => 'ờ', + 'Ở' => 'ở', + 'Ỡ' => 'ỡ', + 'Ợ' => 'ợ', + 'Ụ' => 'ụ', + 'Ủ' => 'ủ', + 'Ứ' => 'ứ', + 'Ừ' => 'ừ', + 'Ử' => 'ử', + 'Ữ' => 'ữ', + 'Ự' => 'ự', + 'Ỳ' => 'ỳ', + 'Ỵ' => 'ỵ', + 'Ỷ' => 'ỷ', + 'Ỹ' => 'ỹ', + 'Ỻ' => 'ỻ', + 'Ỽ' => 'ỽ', + 'Ỿ' => 'ỿ', + 'Ἀ' => 'ἀ', + 'Ἁ' => 'ἁ', + 'Ἂ' => 'ἂ', + 'Ἃ' => 'ἃ', + 'Ἄ' => 'ἄ', + 'Ἅ' => 'ἅ', + 'Ἆ' => 'ἆ', + 'Ἇ' => 'ἇ', + 'Ἐ' => 'ἐ', + 'Ἑ' => 'ἑ', + 'Ἒ' => 'ἒ', + 'Ἓ' => 'ἓ', + 'Ἔ' => 'ἔ', + 'Ἕ' => 'ἕ', + 'Ἠ' => 'ἠ', + 'Ἡ' => 'ἡ', + 'Ἢ' => 'ἢ', + 'Ἣ' => 'ἣ', + 'Ἤ' => 'ἤ', + 'Ἥ' => 'ἥ', + 'Ἦ' => 'ἦ', + 'Ἧ' => 'ἧ', + 'Ἰ' => 'ἰ', + 'Ἱ' => 'ἱ', + 'Ἲ' => 'ἲ', + 'Ἳ' => 'ἳ', + 'Ἴ' => 'ἴ', + 'Ἵ' => 'ἵ', + 'Ἶ' => 'ἶ', + 'Ἷ' => 'ἷ', + 'Ὀ' => 'ὀ', + 'Ὁ' => 'ὁ', + 'Ὂ' => 'ὂ', + 'Ὃ' => 'ὃ', + 'Ὄ' => 'ὄ', + 'Ὅ' => 'ὅ', + 'Ὑ' => 'ὑ', + 'Ὓ' => 'ὓ', + 'Ὕ' => 'ὕ', + 'Ὗ' => 'ὗ', + 'Ὠ' => 'ὠ', + 'Ὡ' => 'ὡ', + 'Ὢ' => 'ὢ', + 'Ὣ' => 'ὣ', + 'Ὤ' => 'ὤ', + 'Ὥ' => 'ὥ', + 'Ὦ' => 'ὦ', + 'Ὧ' => 'ὧ', + 'ᾈ' => 'ᾀ', + 'ᾉ' => 'ᾁ', + 'ᾊ' => 'ᾂ', + 'ᾋ' => 'ᾃ', + 'ᾌ' => 'ᾄ', + 'ᾍ' => 'ᾅ', + 'ᾎ' => 'ᾆ', + 'ᾏ' => 'ᾇ', + 'ᾘ' => 'ᾐ', + 'ᾙ' => 'ᾑ', + 'ᾚ' => 'ᾒ', + 'ᾛ' => 'ᾓ', + 'ᾜ' => 'ᾔ', + 'ᾝ' => 'ᾕ', + 'ᾞ' => 'ᾖ', + 'ᾟ' => 'ᾗ', + 'ᾨ' => 'ᾠ', + 'ᾩ' => 'ᾡ', + 'ᾪ' => 'ᾢ', + 'ᾫ' => 'ᾣ', + 'ᾬ' => 'ᾤ', + 'ᾭ' => 'ᾥ', + 'ᾮ' => 'ᾦ', + 'ᾯ' => 'ᾧ', + 'Ᾰ' => 'ᾰ', + 'Ᾱ' => 'ᾱ', + 'Ὰ' => 'ὰ', + 'Ά' => 'ά', + 'ᾼ' => 'ᾳ', + 'Ὲ' => 'ὲ', + 'Έ' => 'έ', + 'Ὴ' => 'ὴ', + 'Ή' => 'ή', + 'ῌ' => 'ῃ', + 'Ῐ' => 'ῐ', + 'Ῑ' => 'ῑ', + 'Ὶ' => 'ὶ', + 'Ί' => 'ί', + 'Ῠ' => 'ῠ', + 'Ῡ' => 'ῡ', + 'Ὺ' => 'ὺ', + 'Ύ' => 'ύ', + 'Ῥ' => 'ῥ', + 'Ὸ' => 'ὸ', + 'Ό' => 'ό', + 'Ὼ' => 'ὼ', + 'Ώ' => 'ώ', + 'ῼ' => 'ῳ', + 'Ω' => 'ω', + 'K' => 'k', + 'Å' => 'å', + 'Ⅎ' => 'ⅎ', + 'Ⅰ' => 'ⅰ', + 'Ⅱ' => 'ⅱ', + 'Ⅲ' => 'ⅲ', + 'Ⅳ' => 'ⅳ', + 'Ⅴ' => 'ⅴ', + 'Ⅵ' => 'ⅵ', + 'Ⅶ' => 'ⅶ', + 'Ⅷ' => 'ⅷ', + 'Ⅸ' => 'ⅸ', + 'Ⅹ' => 'ⅹ', + 'Ⅺ' => 'ⅺ', + 'Ⅻ' => 'ⅻ', + 'Ⅼ' => 'ⅼ', + 'Ⅽ' => 'ⅽ', + 'Ⅾ' => 'ⅾ', + 'Ⅿ' => 'ⅿ', + 'Ↄ' => 'ↄ', + 'Ⓐ' => 'ⓐ', + 'Ⓑ' => 'ⓑ', + 'Ⓒ' => 'ⓒ', + 'Ⓓ' => 'ⓓ', + 'Ⓔ' => 'ⓔ', + 'Ⓕ' => 'ⓕ', + 'Ⓖ' => 'ⓖ', + 'Ⓗ' => 'ⓗ', + 'Ⓘ' => 'ⓘ', + 'Ⓙ' => 'ⓙ', + 'Ⓚ' => 'ⓚ', + 'Ⓛ' => 'ⓛ', + 'Ⓜ' => 'ⓜ', + 'Ⓝ' => 'ⓝ', + 'Ⓞ' => 'ⓞ', + 'Ⓟ' => 'ⓟ', + 'Ⓠ' => 'ⓠ', + 'Ⓡ' => 'ⓡ', + 'Ⓢ' => 'ⓢ', + 'Ⓣ' => 'ⓣ', + 'Ⓤ' => 'ⓤ', + 'Ⓥ' => 'ⓥ', + 'Ⓦ' => 'ⓦ', + 'Ⓧ' => 'ⓧ', + 'Ⓨ' => 'ⓨ', + 'Ⓩ' => 'ⓩ', + 'Ⰰ' => 'ⰰ', + 'Ⰱ' => 'ⰱ', + 'Ⰲ' => 'ⰲ', + 'Ⰳ' => 'ⰳ', + 'Ⰴ' => 'ⰴ', + 'Ⰵ' => 'ⰵ', + 'Ⰶ' => 'ⰶ', + 'Ⰷ' => 'ⰷ', + 'Ⰸ' => 'ⰸ', + 'Ⰹ' => 'ⰹ', + 'Ⰺ' => 'ⰺ', + 'Ⰻ' => 'ⰻ', + 'Ⰼ' => 'ⰼ', + 'Ⰽ' => 'ⰽ', + 'Ⰾ' => 'ⰾ', + 'Ⰿ' => 'ⰿ', + 'Ⱀ' => 'ⱀ', + 'Ⱁ' => 'ⱁ', + 'Ⱂ' => 'ⱂ', + 'Ⱃ' => 'ⱃ', + 'Ⱄ' => 'ⱄ', + 'Ⱅ' => 'ⱅ', + 'Ⱆ' => 'ⱆ', + 'Ⱇ' => 'ⱇ', + 'Ⱈ' => 'ⱈ', + 'Ⱉ' => 'ⱉ', + 'Ⱊ' => 'ⱊ', + 'Ⱋ' => 'ⱋ', + 'Ⱌ' => 'ⱌ', + 'Ⱍ' => 'ⱍ', + 'Ⱎ' => 'ⱎ', + 'Ⱏ' => 'ⱏ', + 'Ⱐ' => 'ⱐ', + 'Ⱑ' => 'ⱑ', + 'Ⱒ' => 'ⱒ', + 'Ⱓ' => 'ⱓ', + 'Ⱔ' => 'ⱔ', + 'Ⱕ' => 'ⱕ', + 'Ⱖ' => 'ⱖ', + 'Ⱗ' => 'ⱗ', + 'Ⱘ' => 'ⱘ', + 'Ⱙ' => 'ⱙ', + 'Ⱚ' => 'ⱚ', + 'Ⱛ' => 'ⱛ', + 'Ⱜ' => 'ⱜ', + 'Ⱝ' => 'ⱝ', + 'Ⱞ' => 'ⱞ', + 'Ⱡ' => 'ⱡ', + 'Ɫ' => 'ɫ', + 'Ᵽ' => 'ᵽ', + 'Ɽ' => 'ɽ', + 'Ⱨ' => 'ⱨ', + 'Ⱪ' => 'ⱪ', + 'Ⱬ' => 'ⱬ', + 'Ɑ' => 'ɑ', + 'Ɱ' => 'ɱ', + 'Ɐ' => 'ɐ', + 'Ɒ' => 'ɒ', + 'Ⱳ' => 'ⱳ', + 'Ⱶ' => 'ⱶ', + 'Ȿ' => 'ȿ', + 'Ɀ' => 'ɀ', + 'Ⲁ' => 'ⲁ', + 'Ⲃ' => 'ⲃ', + 'Ⲅ' => 'ⲅ', + 'Ⲇ' => 'ⲇ', + 'Ⲉ' => 'ⲉ', + 'Ⲋ' => 'ⲋ', + 'Ⲍ' => 'ⲍ', + 'Ⲏ' => 'ⲏ', + 'Ⲑ' => 'ⲑ', + 'Ⲓ' => 'ⲓ', + 'Ⲕ' => 'ⲕ', + 'Ⲗ' => 'ⲗ', + 'Ⲙ' => 'ⲙ', + 'Ⲛ' => 'ⲛ', + 'Ⲝ' => 'ⲝ', + 'Ⲟ' => 'ⲟ', + 'Ⲡ' => 'ⲡ', + 'Ⲣ' => 'ⲣ', + 'Ⲥ' => 'ⲥ', + 'Ⲧ' => 'ⲧ', + 'Ⲩ' => 'ⲩ', + 'Ⲫ' => 'ⲫ', + 'Ⲭ' => 'ⲭ', + 'Ⲯ' => 'ⲯ', + 'Ⲱ' => 'ⲱ', + 'Ⲳ' => 'ⲳ', + 'Ⲵ' => 'ⲵ', + 'Ⲷ' => 'ⲷ', + 'Ⲹ' => 'ⲹ', + 'Ⲻ' => 'ⲻ', + 'Ⲽ' => 'ⲽ', + 'Ⲿ' => 'ⲿ', + 'Ⳁ' => 'ⳁ', + 'Ⳃ' => 'ⳃ', + 'Ⳅ' => 'ⳅ', + 'Ⳇ' => 'ⳇ', + 'Ⳉ' => 'ⳉ', + 'Ⳋ' => 'ⳋ', + 'Ⳍ' => 'ⳍ', + 'Ⳏ' => 'ⳏ', + 'Ⳑ' => 'ⳑ', + 'Ⳓ' => 'ⳓ', + 'Ⳕ' => 'ⳕ', + 'Ⳗ' => 'ⳗ', + 'Ⳙ' => 'ⳙ', + 'Ⳛ' => 'ⳛ', + 'Ⳝ' => 'ⳝ', + 'Ⳟ' => 'ⳟ', + 'Ⳡ' => 'ⳡ', + 'Ⳣ' => 'ⳣ', + 'Ⳬ' => 'ⳬ', + 'Ⳮ' => 'ⳮ', + 'Ⳳ' => 'ⳳ', + 'Ꙁ' => 'ꙁ', + 'Ꙃ' => 'ꙃ', + 'Ꙅ' => 'ꙅ', + 'Ꙇ' => 'ꙇ', + 'Ꙉ' => 'ꙉ', + 'Ꙋ' => 'ꙋ', + 'Ꙍ' => 'ꙍ', + 'Ꙏ' => 'ꙏ', + 'Ꙑ' => 'ꙑ', + 'Ꙓ' => 'ꙓ', + 'Ꙕ' => 'ꙕ', + 'Ꙗ' => 'ꙗ', + 'Ꙙ' => 'ꙙ', + 'Ꙛ' => 'ꙛ', + 'Ꙝ' => 'ꙝ', + 'Ꙟ' => 'ꙟ', + 'Ꙡ' => 'ꙡ', + 'Ꙣ' => 'ꙣ', + 'Ꙥ' => 'ꙥ', + 'Ꙧ' => 'ꙧ', + 'Ꙩ' => 'ꙩ', + 'Ꙫ' => 'ꙫ', + 'Ꙭ' => 'ꙭ', + 'Ꚁ' => 'ꚁ', + 'Ꚃ' => 'ꚃ', + 'Ꚅ' => 'ꚅ', + 'Ꚇ' => 'ꚇ', + 'Ꚉ' => 'ꚉ', + 'Ꚋ' => 'ꚋ', + 'Ꚍ' => 'ꚍ', + 'Ꚏ' => 'ꚏ', + 'Ꚑ' => 'ꚑ', + 'Ꚓ' => 'ꚓ', + 'Ꚕ' => 'ꚕ', + 'Ꚗ' => 'ꚗ', + 'Ꚙ' => 'ꚙ', + 'Ꚛ' => 'ꚛ', + 'Ꜣ' => 'ꜣ', + 'Ꜥ' => 'ꜥ', + 'Ꜧ' => 'ꜧ', + 'Ꜩ' => 'ꜩ', + 'Ꜫ' => 'ꜫ', + 'Ꜭ' => 'ꜭ', + 'Ꜯ' => 'ꜯ', + 'Ꜳ' => 'ꜳ', + 'Ꜵ' => 'ꜵ', + 'Ꜷ' => 'ꜷ', + 'Ꜹ' => 'ꜹ', + 'Ꜻ' => 'ꜻ', + 'Ꜽ' => 'ꜽ', + 'Ꜿ' => 'ꜿ', + 'Ꝁ' => 'ꝁ', + 'Ꝃ' => 'ꝃ', + 'Ꝅ' => 'ꝅ', + 'Ꝇ' => 'ꝇ', + 'Ꝉ' => 'ꝉ', + 'Ꝋ' => 'ꝋ', + 'Ꝍ' => 'ꝍ', + 'Ꝏ' => 'ꝏ', + 'Ꝑ' => 'ꝑ', + 'Ꝓ' => 'ꝓ', + 'Ꝕ' => 'ꝕ', + 'Ꝗ' => 'ꝗ', + 'Ꝙ' => 'ꝙ', + 'Ꝛ' => 'ꝛ', + 'Ꝝ' => 'ꝝ', + 'Ꝟ' => 'ꝟ', + 'Ꝡ' => 'ꝡ', + 'Ꝣ' => 'ꝣ', + 'Ꝥ' => 'ꝥ', + 'Ꝧ' => 'ꝧ', + 'Ꝩ' => 'ꝩ', + 'Ꝫ' => 'ꝫ', + 'Ꝭ' => 'ꝭ', + 'Ꝯ' => 'ꝯ', + 'Ꝺ' => 'ꝺ', + 'Ꝼ' => 'ꝼ', + 'Ᵹ' => 'ᵹ', + 'Ꝿ' => 'ꝿ', + 'Ꞁ' => 'ꞁ', + 'Ꞃ' => 'ꞃ', + 'Ꞅ' => 'ꞅ', + 'Ꞇ' => 'ꞇ', + 'Ꞌ' => 'ꞌ', + 'Ɥ' => 'ɥ', + 'Ꞑ' => 'ꞑ', + 'Ꞓ' => 'ꞓ', + 'Ꞗ' => 'ꞗ', + 'Ꞙ' => 'ꞙ', + 'Ꞛ' => 'ꞛ', + 'Ꞝ' => 'ꞝ', + 'Ꞟ' => 'ꞟ', + 'Ꞡ' => 'ꞡ', + 'Ꞣ' => 'ꞣ', + 'Ꞥ' => 'ꞥ', + 'Ꞧ' => 'ꞧ', + 'Ꞩ' => 'ꞩ', + 'Ɦ' => 'ɦ', + 'Ɜ' => 'ɜ', + 'Ɡ' => 'ɡ', + 'Ɬ' => 'ɬ', + 'Ʞ' => 'ʞ', + 'Ʇ' => 'ʇ', + 'A' => 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + '𐐀' => '𐐨', + '𐐁' => '𐐩', + '𐐂' => '𐐪', + '𐐃' => '𐐫', + '𐐄' => '𐐬', + '𐐅' => '𐐭', + '𐐆' => '𐐮', + '𐐇' => '𐐯', + '𐐈' => '𐐰', + '𐐉' => '𐐱', + '𐐊' => '𐐲', + '𐐋' => '𐐳', + '𐐌' => '𐐴', + '𐐍' => '𐐵', + '𐐎' => '𐐶', + '𐐏' => '𐐷', + '𐐐' => '𐐸', + '𐐑' => '𐐹', + '𐐒' => '𐐺', + '𐐓' => '𐐻', + '𐐔' => '𐐼', + '𐐕' => '𐐽', + '𐐖' => '𐐾', + '𐐗' => '𐐿', + '𐐘' => '𐑀', + '𐐙' => '𐑁', + '𐐚' => '𐑂', + '𐐛' => '𐑃', + '𐐜' => '𐑄', + '𐐝' => '𐑅', + '𐐞' => '𐑆', + '𐐟' => '𐑇', + '𐐠' => '𐑈', + '𐐡' => '𐑉', + '𐐢' => '𐑊', + '𐐣' => '𐑋', + '𐐤' => '𐑌', + '𐐥' => '𐑍', + '𐐦' => '𐑎', + '𐐧' => '𐑏', + '𑢠' => '𑣀', + '𑢡' => '𑣁', + '𑢢' => '𑣂', + '𑢣' => '𑣃', + '𑢤' => '𑣄', + '𑢥' => '𑣅', + '𑢦' => '𑣆', + '𑢧' => '𑣇', + '𑢨' => '𑣈', + '𑢩' => '𑣉', + '𑢪' => '𑣊', + '𑢫' => '𑣋', + '𑢬' => '𑣌', + '𑢭' => '𑣍', + '𑢮' => '𑣎', + '𑢯' => '𑣏', + '𑢰' => '𑣐', + '𑢱' => '𑣑', + '𑢲' => '𑣒', + '𑢳' => '𑣓', + '𑢴' => '𑣔', + '𑢵' => '𑣕', + '𑢶' => '𑣖', + '𑢷' => '𑣗', + '𑢸' => '𑣘', + '𑢹' => '𑣙', + '𑢺' => '𑣚', + '𑢻' => '𑣛', + '𑢼' => '𑣜', + '𑢽' => '𑣝', + '𑢾' => '𑣞', + '𑢿' => '𑣟', +); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100644 index 00000000..2a8f6e73 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ + 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + 'µ' => 'Μ', + 'à' => 'À', + 'á' => 'Á', + 'â' => 'Â', + 'ã' => 'Ã', + 'ä' => 'Ä', + 'å' => 'Å', + 'æ' => 'Æ', + 'ç' => 'Ç', + 'è' => 'È', + 'é' => 'É', + 'ê' => 'Ê', + 'ë' => 'Ë', + 'ì' => 'Ì', + 'í' => 'Í', + 'î' => 'Î', + 'ï' => 'Ï', + 'ð' => 'Ð', + 'ñ' => 'Ñ', + 'ò' => 'Ò', + 'ó' => 'Ó', + 'ô' => 'Ô', + 'õ' => 'Õ', + 'ö' => 'Ö', + 'ø' => 'Ø', + 'ù' => 'Ù', + 'ú' => 'Ú', + 'û' => 'Û', + 'ü' => 'Ü', + 'ý' => 'Ý', + 'þ' => 'Þ', + 'ÿ' => 'Ÿ', + 'ā' => 'Ā', + 'ă' => 'Ă', + 'ą' => 'Ą', + 'ć' => 'Ć', + 'ĉ' => 'Ĉ', + 'ċ' => 'Ċ', + 'č' => 'Č', + 'ď' => 'Ď', + 'đ' => 'Đ', + 'ē' => 'Ē', + 'ĕ' => 'Ĕ', + 'ė' => 'Ė', + 'ę' => 'Ę', + 'ě' => 'Ě', + 'ĝ' => 'Ĝ', + 'ğ' => 'Ğ', + 'ġ' => 'Ġ', + 'ģ' => 'Ģ', + 'ĥ' => 'Ĥ', + 'ħ' => 'Ħ', + 'ĩ' => 'Ĩ', + 'ī' => 'Ī', + 'ĭ' => 'Ĭ', + 'į' => 'Į', + 'ı' => 'I', + 'ij' => 'IJ', + 'ĵ' => 'Ĵ', + 'ķ' => 'Ķ', + 'ĺ' => 'Ĺ', + 'ļ' => 'Ļ', + 'ľ' => 'Ľ', + 'ŀ' => 'Ŀ', + 'ł' => 'Ł', + 'ń' => 'Ń', + 'ņ' => 'Ņ', + 'ň' => 'Ň', + 'ŋ' => 'Ŋ', + 'ō' => 'Ō', + 'ŏ' => 'Ŏ', + 'ő' => 'Ő', + 'œ' => 'Œ', + 'ŕ' => 'Ŕ', + 'ŗ' => 'Ŗ', + 'ř' => 'Ř', + 'ś' => 'Ś', + 'ŝ' => 'Ŝ', + 'ş' => 'Ş', + 'š' => 'Š', + 'ţ' => 'Ţ', + 'ť' => 'Ť', + 'ŧ' => 'Ŧ', + 'ũ' => 'Ũ', + 'ū' => 'Ū', + 'ŭ' => 'Ŭ', + 'ů' => 'Ů', + 'ű' => 'Ű', + 'ų' => 'Ų', + 'ŵ' => 'Ŵ', + 'ŷ' => 'Ŷ', + 'ź' => 'Ź', + 'ż' => 'Ż', + 'ž' => 'Ž', + 'ſ' => 'S', + 'ƀ' => 'Ƀ', + 'ƃ' => 'Ƃ', + 'ƅ' => 'Ƅ', + 'ƈ' => 'Ƈ', + 'ƌ' => 'Ƌ', + 'ƒ' => 'Ƒ', + 'ƕ' => 'Ƕ', + 'ƙ' => 'Ƙ', + 'ƚ' => 'Ƚ', + 'ƞ' => 'Ƞ', + 'ơ' => 'Ơ', + 'ƣ' => 'Ƣ', + 'ƥ' => 'Ƥ', + 'ƨ' => 'Ƨ', + 'ƭ' => 'Ƭ', + 'ư' => 'Ư', + 'ƴ' => 'Ƴ', + 'ƶ' => 'Ƶ', + 'ƹ' => 'Ƹ', + 'ƽ' => 'Ƽ', + 'ƿ' => 'Ƿ', + 'Dž' => 'DŽ', + 'dž' => 'DŽ', + 'Lj' => 'LJ', + 'lj' => 'LJ', + 'Nj' => 'NJ', + 'nj' => 'NJ', + 'ǎ' => 'Ǎ', + 'ǐ' => 'Ǐ', + 'ǒ' => 'Ǒ', + 'ǔ' => 'Ǔ', + 'ǖ' => 'Ǖ', + 'ǘ' => 'Ǘ', + 'ǚ' => 'Ǚ', + 'ǜ' => 'Ǜ', + 'ǝ' => 'Ǝ', + 'ǟ' => 'Ǟ', + 'ǡ' => 'Ǡ', + 'ǣ' => 'Ǣ', + 'ǥ' => 'Ǥ', + 'ǧ' => 'Ǧ', + 'ǩ' => 'Ǩ', + 'ǫ' => 'Ǫ', + 'ǭ' => 'Ǭ', + 'ǯ' => 'Ǯ', + 'Dz' => 'DZ', + 'dz' => 'DZ', + 'ǵ' => 'Ǵ', + 'ǹ' => 'Ǹ', + 'ǻ' => 'Ǻ', + 'ǽ' => 'Ǽ', + 'ǿ' => 'Ǿ', + 'ȁ' => 'Ȁ', + 'ȃ' => 'Ȃ', + 'ȅ' => 'Ȅ', + 'ȇ' => 'Ȇ', + 'ȉ' => 'Ȉ', + 'ȋ' => 'Ȋ', + 'ȍ' => 'Ȍ', + 'ȏ' => 'Ȏ', + 'ȑ' => 'Ȑ', + 'ȓ' => 'Ȓ', + 'ȕ' => 'Ȕ', + 'ȗ' => 'Ȗ', + 'ș' => 'Ș', + 'ț' => 'Ț', + 'ȝ' => 'Ȝ', + 'ȟ' => 'Ȟ', + 'ȣ' => 'Ȣ', + 'ȥ' => 'Ȥ', + 'ȧ' => 'Ȧ', + 'ȩ' => 'Ȩ', + 'ȫ' => 'Ȫ', + 'ȭ' => 'Ȭ', + 'ȯ' => 'Ȯ', + 'ȱ' => 'Ȱ', + 'ȳ' => 'Ȳ', + 'ȼ' => 'Ȼ', + 'ȿ' => 'Ȿ', + 'ɀ' => 'Ɀ', + 'ɂ' => 'Ɂ', + 'ɇ' => 'Ɇ', + 'ɉ' => 'Ɉ', + 'ɋ' => 'Ɋ', + 'ɍ' => 'Ɍ', + 'ɏ' => 'Ɏ', + 'ɐ' => 'Ɐ', + 'ɑ' => 'Ɑ', + 'ɒ' => 'Ɒ', + 'ɓ' => 'Ɓ', + 'ɔ' => 'Ɔ', + 'ɖ' => 'Ɖ', + 'ɗ' => 'Ɗ', + 'ə' => 'Ə', + 'ɛ' => 'Ɛ', + 'ɜ' => 'Ɜ', + 'ɠ' => 'Ɠ', + 'ɡ' => 'Ɡ', + 'ɣ' => 'Ɣ', + 'ɥ' => 'Ɥ', + 'ɦ' => 'Ɦ', + 'ɨ' => 'Ɨ', + 'ɩ' => 'Ɩ', + 'ɫ' => 'Ɫ', + 'ɬ' => 'Ɬ', + 'ɯ' => 'Ɯ', + 'ɱ' => 'Ɱ', + 'ɲ' => 'Ɲ', + 'ɵ' => 'Ɵ', + 'ɽ' => 'Ɽ', + 'ʀ' => 'Ʀ', + 'ʃ' => 'Ʃ', + 'ʇ' => 'Ʇ', + 'ʈ' => 'Ʈ', + 'ʉ' => 'Ʉ', + 'ʊ' => 'Ʊ', + 'ʋ' => 'Ʋ', + 'ʌ' => 'Ʌ', + 'ʒ' => 'Ʒ', + 'ʞ' => 'Ʞ', + 'ͅ' => 'Ι', + 'ͱ' => 'Ͱ', + 'ͳ' => 'Ͳ', + 'ͷ' => 'Ͷ', + 'ͻ' => 'Ͻ', + 'ͼ' => 'Ͼ', + 'ͽ' => 'Ͽ', + 'ά' => 'Ά', + 'έ' => 'Έ', + 'ή' => 'Ή', + 'ί' => 'Ί', + 'α' => 'Α', + 'β' => 'Β', + 'γ' => 'Γ', + 'δ' => 'Δ', + 'ε' => 'Ε', + 'ζ' => 'Ζ', + 'η' => 'Η', + 'θ' => 'Θ', + 'ι' => 'Ι', + 'κ' => 'Κ', + 'λ' => 'Λ', + 'μ' => 'Μ', + 'ν' => 'Ν', + 'ξ' => 'Ξ', + 'ο' => 'Ο', + 'π' => 'Π', + 'ρ' => 'Ρ', + 'ς' => 'Σ', + 'σ' => 'Σ', + 'τ' => 'Τ', + 'υ' => 'Υ', + 'φ' => 'Φ', + 'χ' => 'Χ', + 'ψ' => 'Ψ', + 'ω' => 'Ω', + 'ϊ' => 'Ϊ', + 'ϋ' => 'Ϋ', + 'ό' => 'Ό', + 'ύ' => 'Ύ', + 'ώ' => 'Ώ', + 'ϐ' => 'Β', + 'ϑ' => 'Θ', + 'ϕ' => 'Φ', + 'ϖ' => 'Π', + 'ϗ' => 'Ϗ', + 'ϙ' => 'Ϙ', + 'ϛ' => 'Ϛ', + 'ϝ' => 'Ϝ', + 'ϟ' => 'Ϟ', + 'ϡ' => 'Ϡ', + 'ϣ' => 'Ϣ', + 'ϥ' => 'Ϥ', + 'ϧ' => 'Ϧ', + 'ϩ' => 'Ϩ', + 'ϫ' => 'Ϫ', + 'ϭ' => 'Ϭ', + 'ϯ' => 'Ϯ', + 'ϰ' => 'Κ', + 'ϱ' => 'Ρ', + 'ϲ' => 'Ϲ', + 'ϳ' => 'Ϳ', + 'ϵ' => 'Ε', + 'ϸ' => 'Ϸ', + 'ϻ' => 'Ϻ', + 'а' => 'А', + 'б' => 'Б', + 'в' => 'В', + 'г' => 'Г', + 'д' => 'Д', + 'е' => 'Е', + 'ж' => 'Ж', + 'з' => 'З', + 'и' => 'И', + 'й' => 'Й', + 'к' => 'К', + 'л' => 'Л', + 'м' => 'М', + 'н' => 'Н', + 'о' => 'О', + 'п' => 'П', + 'р' => 'Р', + 'с' => 'С', + 'т' => 'Т', + 'у' => 'У', + 'ф' => 'Ф', + 'х' => 'Х', + 'ц' => 'Ц', + 'ч' => 'Ч', + 'ш' => 'Ш', + 'щ' => 'Щ', + 'ъ' => 'Ъ', + 'ы' => 'Ы', + 'ь' => 'Ь', + 'э' => 'Э', + 'ю' => 'Ю', + 'я' => 'Я', + 'ѐ' => 'Ѐ', + 'ё' => 'Ё', + 'ђ' => 'Ђ', + 'ѓ' => 'Ѓ', + 'є' => 'Є', + 'ѕ' => 'Ѕ', + 'і' => 'І', + 'ї' => 'Ї', + 'ј' => 'Ј', + 'љ' => 'Љ', + 'њ' => 'Њ', + 'ћ' => 'Ћ', + 'ќ' => 'Ќ', + 'ѝ' => 'Ѝ', + 'ў' => 'Ў', + 'џ' => 'Џ', + 'ѡ' => 'Ѡ', + 'ѣ' => 'Ѣ', + 'ѥ' => 'Ѥ', + 'ѧ' => 'Ѧ', + 'ѩ' => 'Ѩ', + 'ѫ' => 'Ѫ', + 'ѭ' => 'Ѭ', + 'ѯ' => 'Ѯ', + 'ѱ' => 'Ѱ', + 'ѳ' => 'Ѳ', + 'ѵ' => 'Ѵ', + 'ѷ' => 'Ѷ', + 'ѹ' => 'Ѹ', + 'ѻ' => 'Ѻ', + 'ѽ' => 'Ѽ', + 'ѿ' => 'Ѿ', + 'ҁ' => 'Ҁ', + 'ҋ' => 'Ҋ', + 'ҍ' => 'Ҍ', + 'ҏ' => 'Ҏ', + 'ґ' => 'Ґ', + 'ғ' => 'Ғ', + 'ҕ' => 'Ҕ', + 'җ' => 'Җ', + 'ҙ' => 'Ҙ', + 'қ' => 'Қ', + 'ҝ' => 'Ҝ', + 'ҟ' => 'Ҟ', + 'ҡ' => 'Ҡ', + 'ң' => 'Ң', + 'ҥ' => 'Ҥ', + 'ҧ' => 'Ҧ', + 'ҩ' => 'Ҩ', + 'ҫ' => 'Ҫ', + 'ҭ' => 'Ҭ', + 'ү' => 'Ү', + 'ұ' => 'Ұ', + 'ҳ' => 'Ҳ', + 'ҵ' => 'Ҵ', + 'ҷ' => 'Ҷ', + 'ҹ' => 'Ҹ', + 'һ' => 'Һ', + 'ҽ' => 'Ҽ', + 'ҿ' => 'Ҿ', + 'ӂ' => 'Ӂ', + 'ӄ' => 'Ӄ', + 'ӆ' => 'Ӆ', + 'ӈ' => 'Ӈ', + 'ӊ' => 'Ӊ', + 'ӌ' => 'Ӌ', + 'ӎ' => 'Ӎ', + 'ӏ' => 'Ӏ', + 'ӑ' => 'Ӑ', + 'ӓ' => 'Ӓ', + 'ӕ' => 'Ӕ', + 'ӗ' => 'Ӗ', + 'ә' => 'Ә', + 'ӛ' => 'Ӛ', + 'ӝ' => 'Ӝ', + 'ӟ' => 'Ӟ', + 'ӡ' => 'Ӡ', + 'ӣ' => 'Ӣ', + 'ӥ' => 'Ӥ', + 'ӧ' => 'Ӧ', + 'ө' => 'Ө', + 'ӫ' => 'Ӫ', + 'ӭ' => 'Ӭ', + 'ӯ' => 'Ӯ', + 'ӱ' => 'Ӱ', + 'ӳ' => 'Ӳ', + 'ӵ' => 'Ӵ', + 'ӷ' => 'Ӷ', + 'ӹ' => 'Ӹ', + 'ӻ' => 'Ӻ', + 'ӽ' => 'Ӽ', + 'ӿ' => 'Ӿ', + 'ԁ' => 'Ԁ', + 'ԃ' => 'Ԃ', + 'ԅ' => 'Ԅ', + 'ԇ' => 'Ԇ', + 'ԉ' => 'Ԉ', + 'ԋ' => 'Ԋ', + 'ԍ' => 'Ԍ', + 'ԏ' => 'Ԏ', + 'ԑ' => 'Ԑ', + 'ԓ' => 'Ԓ', + 'ԕ' => 'Ԕ', + 'ԗ' => 'Ԗ', + 'ԙ' => 'Ԙ', + 'ԛ' => 'Ԛ', + 'ԝ' => 'Ԝ', + 'ԟ' => 'Ԟ', + 'ԡ' => 'Ԡ', + 'ԣ' => 'Ԣ', + 'ԥ' => 'Ԥ', + 'ԧ' => 'Ԧ', + 'ԩ' => 'Ԩ', + 'ԫ' => 'Ԫ', + 'ԭ' => 'Ԭ', + 'ԯ' => 'Ԯ', + 'ա' => 'Ա', + 'բ' => 'Բ', + 'գ' => 'Գ', + 'դ' => 'Դ', + 'ե' => 'Ե', + 'զ' => 'Զ', + 'է' => 'Է', + 'ը' => 'Ը', + 'թ' => 'Թ', + 'ժ' => 'Ժ', + 'ի' => 'Ի', + 'լ' => 'Լ', + 'խ' => 'Խ', + 'ծ' => 'Ծ', + 'կ' => 'Կ', + 'հ' => 'Հ', + 'ձ' => 'Ձ', + 'ղ' => 'Ղ', + 'ճ' => 'Ճ', + 'մ' => 'Մ', + 'յ' => 'Յ', + 'ն' => 'Ն', + 'շ' => 'Շ', + 'ո' => 'Ո', + 'չ' => 'Չ', + 'պ' => 'Պ', + 'ջ' => 'Ջ', + 'ռ' => 'Ռ', + 'ս' => 'Ս', + 'վ' => 'Վ', + 'տ' => 'Տ', + 'ր' => 'Ր', + 'ց' => 'Ց', + 'ւ' => 'Ւ', + 'փ' => 'Փ', + 'ք' => 'Ք', + 'օ' => 'Օ', + 'ֆ' => 'Ֆ', + 'ᵹ' => 'Ᵹ', + 'ᵽ' => 'Ᵽ', + 'ḁ' => 'Ḁ', + 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', + 'ḇ' => 'Ḇ', + 'ḉ' => 'Ḉ', + 'ḋ' => 'Ḋ', + 'ḍ' => 'Ḍ', + 'ḏ' => 'Ḏ', + 'ḑ' => 'Ḑ', + 'ḓ' => 'Ḓ', + 'ḕ' => 'Ḕ', + 'ḗ' => 'Ḗ', + 'ḙ' => 'Ḙ', + 'ḛ' => 'Ḛ', + 'ḝ' => 'Ḝ', + 'ḟ' => 'Ḟ', + 'ḡ' => 'Ḡ', + 'ḣ' => 'Ḣ', + 'ḥ' => 'Ḥ', + 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', + 'ḫ' => 'Ḫ', + 'ḭ' => 'Ḭ', + 'ḯ' => 'Ḯ', + 'ḱ' => 'Ḱ', + 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', + 'ḷ' => 'Ḷ', + 'ḹ' => 'Ḹ', + 'ḻ' => 'Ḻ', + 'ḽ' => 'Ḽ', + 'ḿ' => 'Ḿ', + 'ṁ' => 'Ṁ', + 'ṃ' => 'Ṃ', + 'ṅ' => 'Ṅ', + 'ṇ' => 'Ṇ', + 'ṉ' => 'Ṉ', + 'ṋ' => 'Ṋ', + 'ṍ' => 'Ṍ', + 'ṏ' => 'Ṏ', + 'ṑ' => 'Ṑ', + 'ṓ' => 'Ṓ', + 'ṕ' => 'Ṕ', + 'ṗ' => 'Ṗ', + 'ṙ' => 'Ṙ', + 'ṛ' => 'Ṛ', + 'ṝ' => 'Ṝ', + 'ṟ' => 'Ṟ', + 'ṡ' => 'Ṡ', + 'ṣ' => 'Ṣ', + 'ṥ' => 'Ṥ', + 'ṧ' => 'Ṧ', + 'ṩ' => 'Ṩ', + 'ṫ' => 'Ṫ', + 'ṭ' => 'Ṭ', + 'ṯ' => 'Ṯ', + 'ṱ' => 'Ṱ', + 'ṳ' => 'Ṳ', + 'ṵ' => 'Ṵ', + 'ṷ' => 'Ṷ', + 'ṹ' => 'Ṹ', + 'ṻ' => 'Ṻ', + 'ṽ' => 'Ṽ', + 'ṿ' => 'Ṿ', + 'ẁ' => 'Ẁ', + 'ẃ' => 'Ẃ', + 'ẅ' => 'Ẅ', + 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', + 'ẋ' => 'Ẋ', + 'ẍ' => 'Ẍ', + 'ẏ' => 'Ẏ', + 'ẑ' => 'Ẑ', + 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', + 'ẛ' => 'Ṡ', + 'ạ' => 'Ạ', + 'ả' => 'Ả', + 'ấ' => 'Ấ', + 'ầ' => 'Ầ', + 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', + 'ậ' => 'Ậ', + 'ắ' => 'Ắ', + 'ằ' => 'Ằ', + 'ẳ' => 'Ẳ', + 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', + 'ẹ' => 'Ẹ', + 'ẻ' => 'Ẻ', + 'ẽ' => 'Ẽ', + 'ế' => 'Ế', + 'ề' => 'Ề', + 'ể' => 'Ể', + 'ễ' => 'Ễ', + 'ệ' => 'Ệ', + 'ỉ' => 'Ỉ', + 'ị' => 'Ị', + 'ọ' => 'Ọ', + 'ỏ' => 'Ỏ', + 'ố' => 'Ố', + 'ồ' => 'Ồ', + 'ổ' => 'Ổ', + 'ỗ' => 'Ỗ', + 'ộ' => 'Ộ', + 'ớ' => 'Ớ', + 'ờ' => 'Ờ', + 'ở' => 'Ở', + 'ỡ' => 'Ỡ', + 'ợ' => 'Ợ', + 'ụ' => 'Ụ', + 'ủ' => 'Ủ', + 'ứ' => 'Ứ', + 'ừ' => 'Ừ', + 'ử' => 'Ử', + 'ữ' => 'Ữ', + 'ự' => 'Ự', + 'ỳ' => 'Ỳ', + 'ỵ' => 'Ỵ', + 'ỷ' => 'Ỷ', + 'ỹ' => 'Ỹ', + 'ỻ' => 'Ỻ', + 'ỽ' => 'Ỽ', + 'ỿ' => 'Ỿ', + 'ἀ' => 'Ἀ', + 'ἁ' => 'Ἁ', + 'ἂ' => 'Ἂ', + 'ἃ' => 'Ἃ', + 'ἄ' => 'Ἄ', + 'ἅ' => 'Ἅ', + 'ἆ' => 'Ἆ', + 'ἇ' => 'Ἇ', + 'ἐ' => 'Ἐ', + 'ἑ' => 'Ἑ', + 'ἒ' => 'Ἒ', + 'ἓ' => 'Ἓ', + 'ἔ' => 'Ἔ', + 'ἕ' => 'Ἕ', + 'ἠ' => 'Ἠ', + 'ἡ' => 'Ἡ', + 'ἢ' => 'Ἢ', + 'ἣ' => 'Ἣ', + 'ἤ' => 'Ἤ', + 'ἥ' => 'Ἥ', + 'ἦ' => 'Ἦ', + 'ἧ' => 'Ἧ', + 'ἰ' => 'Ἰ', + 'ἱ' => 'Ἱ', + 'ἲ' => 'Ἲ', + 'ἳ' => 'Ἳ', + 'ἴ' => 'Ἴ', + 'ἵ' => 'Ἵ', + 'ἶ' => 'Ἶ', + 'ἷ' => 'Ἷ', + 'ὀ' => 'Ὀ', + 'ὁ' => 'Ὁ', + 'ὂ' => 'Ὂ', + 'ὃ' => 'Ὃ', + 'ὄ' => 'Ὄ', + 'ὅ' => 'Ὅ', + 'ὑ' => 'Ὑ', + 'ὓ' => 'Ὓ', + 'ὕ' => 'Ὕ', + 'ὗ' => 'Ὗ', + 'ὠ' => 'Ὠ', + 'ὡ' => 'Ὡ', + 'ὢ' => 'Ὢ', + 'ὣ' => 'Ὣ', + 'ὤ' => 'Ὤ', + 'ὥ' => 'Ὥ', + 'ὦ' => 'Ὦ', + 'ὧ' => 'Ὧ', + 'ὰ' => 'Ὰ', + 'ά' => 'Ά', + 'ὲ' => 'Ὲ', + 'έ' => 'Έ', + 'ὴ' => 'Ὴ', + 'ή' => 'Ή', + 'ὶ' => 'Ὶ', + 'ί' => 'Ί', + 'ὸ' => 'Ὸ', + 'ό' => 'Ό', + 'ὺ' => 'Ὺ', + 'ύ' => 'Ύ', + 'ὼ' => 'Ὼ', + 'ώ' => 'Ώ', + 'ᾀ' => 'ᾈ', + 'ᾁ' => 'ᾉ', + 'ᾂ' => 'ᾊ', + 'ᾃ' => 'ᾋ', + 'ᾄ' => 'ᾌ', + 'ᾅ' => 'ᾍ', + 'ᾆ' => 'ᾎ', + 'ᾇ' => 'ᾏ', + 'ᾐ' => 'ᾘ', + 'ᾑ' => 'ᾙ', + 'ᾒ' => 'ᾚ', + 'ᾓ' => 'ᾛ', + 'ᾔ' => 'ᾜ', + 'ᾕ' => 'ᾝ', + 'ᾖ' => 'ᾞ', + 'ᾗ' => 'ᾟ', + 'ᾠ' => 'ᾨ', + 'ᾡ' => 'ᾩ', + 'ᾢ' => 'ᾪ', + 'ᾣ' => 'ᾫ', + 'ᾤ' => 'ᾬ', + 'ᾥ' => 'ᾭ', + 'ᾦ' => 'ᾮ', + 'ᾧ' => 'ᾯ', + 'ᾰ' => 'Ᾰ', + 'ᾱ' => 'Ᾱ', + 'ᾳ' => 'ᾼ', + 'ι' => 'Ι', + 'ῃ' => 'ῌ', + 'ῐ' => 'Ῐ', + 'ῑ' => 'Ῑ', + 'ῠ' => 'Ῠ', + 'ῡ' => 'Ῡ', + 'ῥ' => 'Ῥ', + 'ῳ' => 'ῼ', + 'ⅎ' => 'Ⅎ', + 'ⅰ' => 'Ⅰ', + 'ⅱ' => 'Ⅱ', + 'ⅲ' => 'Ⅲ', + 'ⅳ' => 'Ⅳ', + 'ⅴ' => 'Ⅴ', + 'ⅵ' => 'Ⅵ', + 'ⅶ' => 'Ⅶ', + 'ⅷ' => 'Ⅷ', + 'ⅸ' => 'Ⅸ', + 'ⅹ' => 'Ⅹ', + 'ⅺ' => 'Ⅺ', + 'ⅻ' => 'Ⅻ', + 'ⅼ' => 'Ⅼ', + 'ⅽ' => 'Ⅽ', + 'ⅾ' => 'Ⅾ', + 'ⅿ' => 'Ⅿ', + 'ↄ' => 'Ↄ', + 'ⓐ' => 'Ⓐ', + 'ⓑ' => 'Ⓑ', + 'ⓒ' => 'Ⓒ', + 'ⓓ' => 'Ⓓ', + 'ⓔ' => 'Ⓔ', + 'ⓕ' => 'Ⓕ', + 'ⓖ' => 'Ⓖ', + 'ⓗ' => 'Ⓗ', + 'ⓘ' => 'Ⓘ', + 'ⓙ' => 'Ⓙ', + 'ⓚ' => 'Ⓚ', + 'ⓛ' => 'Ⓛ', + 'ⓜ' => 'Ⓜ', + 'ⓝ' => 'Ⓝ', + 'ⓞ' => 'Ⓞ', + 'ⓟ' => 'Ⓟ', + 'ⓠ' => 'Ⓠ', + 'ⓡ' => 'Ⓡ', + 'ⓢ' => 'Ⓢ', + 'ⓣ' => 'Ⓣ', + 'ⓤ' => 'Ⓤ', + 'ⓥ' => 'Ⓥ', + 'ⓦ' => 'Ⓦ', + 'ⓧ' => 'Ⓧ', + 'ⓨ' => 'Ⓨ', + 'ⓩ' => 'Ⓩ', + 'ⰰ' => 'Ⰰ', + 'ⰱ' => 'Ⰱ', + 'ⰲ' => 'Ⰲ', + 'ⰳ' => 'Ⰳ', + 'ⰴ' => 'Ⰴ', + 'ⰵ' => 'Ⰵ', + 'ⰶ' => 'Ⰶ', + 'ⰷ' => 'Ⰷ', + 'ⰸ' => 'Ⰸ', + 'ⰹ' => 'Ⰹ', + 'ⰺ' => 'Ⰺ', + 'ⰻ' => 'Ⰻ', + 'ⰼ' => 'Ⰼ', + 'ⰽ' => 'Ⰽ', + 'ⰾ' => 'Ⰾ', + 'ⰿ' => 'Ⰿ', + 'ⱀ' => 'Ⱀ', + 'ⱁ' => 'Ⱁ', + 'ⱂ' => 'Ⱂ', + 'ⱃ' => 'Ⱃ', + 'ⱄ' => 'Ⱄ', + 'ⱅ' => 'Ⱅ', + 'ⱆ' => 'Ⱆ', + 'ⱇ' => 'Ⱇ', + 'ⱈ' => 'Ⱈ', + 'ⱉ' => 'Ⱉ', + 'ⱊ' => 'Ⱊ', + 'ⱋ' => 'Ⱋ', + 'ⱌ' => 'Ⱌ', + 'ⱍ' => 'Ⱍ', + 'ⱎ' => 'Ⱎ', + 'ⱏ' => 'Ⱏ', + 'ⱐ' => 'Ⱐ', + 'ⱑ' => 'Ⱑ', + 'ⱒ' => 'Ⱒ', + 'ⱓ' => 'Ⱓ', + 'ⱔ' => 'Ⱔ', + 'ⱕ' => 'Ⱕ', + 'ⱖ' => 'Ⱖ', + 'ⱗ' => 'Ⱗ', + 'ⱘ' => 'Ⱘ', + 'ⱙ' => 'Ⱙ', + 'ⱚ' => 'Ⱚ', + 'ⱛ' => 'Ⱛ', + 'ⱜ' => 'Ⱜ', + 'ⱝ' => 'Ⱝ', + 'ⱞ' => 'Ⱞ', + 'ⱡ' => 'Ⱡ', + 'ⱥ' => 'Ⱥ', + 'ⱦ' => 'Ⱦ', + 'ⱨ' => 'Ⱨ', + 'ⱪ' => 'Ⱪ', + 'ⱬ' => 'Ⱬ', + 'ⱳ' => 'Ⱳ', + 'ⱶ' => 'Ⱶ', + 'ⲁ' => 'Ⲁ', + 'ⲃ' => 'Ⲃ', + 'ⲅ' => 'Ⲅ', + 'ⲇ' => 'Ⲇ', + 'ⲉ' => 'Ⲉ', + 'ⲋ' => 'Ⲋ', + 'ⲍ' => 'Ⲍ', + 'ⲏ' => 'Ⲏ', + 'ⲑ' => 'Ⲑ', + 'ⲓ' => 'Ⲓ', + 'ⲕ' => 'Ⲕ', + 'ⲗ' => 'Ⲗ', + 'ⲙ' => 'Ⲙ', + 'ⲛ' => 'Ⲛ', + 'ⲝ' => 'Ⲝ', + 'ⲟ' => 'Ⲟ', + 'ⲡ' => 'Ⲡ', + 'ⲣ' => 'Ⲣ', + 'ⲥ' => 'Ⲥ', + 'ⲧ' => 'Ⲧ', + 'ⲩ' => 'Ⲩ', + 'ⲫ' => 'Ⲫ', + 'ⲭ' => 'Ⲭ', + 'ⲯ' => 'Ⲯ', + 'ⲱ' => 'Ⲱ', + 'ⲳ' => 'Ⲳ', + 'ⲵ' => 'Ⲵ', + 'ⲷ' => 'Ⲷ', + 'ⲹ' => 'Ⲹ', + 'ⲻ' => 'Ⲻ', + 'ⲽ' => 'Ⲽ', + 'ⲿ' => 'Ⲿ', + 'ⳁ' => 'Ⳁ', + 'ⳃ' => 'Ⳃ', + 'ⳅ' => 'Ⳅ', + 'ⳇ' => 'Ⳇ', + 'ⳉ' => 'Ⳉ', + 'ⳋ' => 'Ⳋ', + 'ⳍ' => 'Ⳍ', + 'ⳏ' => 'Ⳏ', + 'ⳑ' => 'Ⳑ', + 'ⳓ' => 'Ⳓ', + 'ⳕ' => 'Ⳕ', + 'ⳗ' => 'Ⳗ', + 'ⳙ' => 'Ⳙ', + 'ⳛ' => 'Ⳛ', + 'ⳝ' => 'Ⳝ', + 'ⳟ' => 'Ⳟ', + 'ⳡ' => 'Ⳡ', + 'ⳣ' => 'Ⳣ', + 'ⳬ' => 'Ⳬ', + 'ⳮ' => 'Ⳮ', + 'ⳳ' => 'Ⳳ', + 'ⴀ' => 'Ⴀ', + 'ⴁ' => 'Ⴁ', + 'ⴂ' => 'Ⴂ', + 'ⴃ' => 'Ⴃ', + 'ⴄ' => 'Ⴄ', + 'ⴅ' => 'Ⴅ', + 'ⴆ' => 'Ⴆ', + 'ⴇ' => 'Ⴇ', + 'ⴈ' => 'Ⴈ', + 'ⴉ' => 'Ⴉ', + 'ⴊ' => 'Ⴊ', + 'ⴋ' => 'Ⴋ', + 'ⴌ' => 'Ⴌ', + 'ⴍ' => 'Ⴍ', + 'ⴎ' => 'Ⴎ', + 'ⴏ' => 'Ⴏ', + 'ⴐ' => 'Ⴐ', + 'ⴑ' => 'Ⴑ', + 'ⴒ' => 'Ⴒ', + 'ⴓ' => 'Ⴓ', + 'ⴔ' => 'Ⴔ', + 'ⴕ' => 'Ⴕ', + 'ⴖ' => 'Ⴖ', + 'ⴗ' => 'Ⴗ', + 'ⴘ' => 'Ⴘ', + 'ⴙ' => 'Ⴙ', + 'ⴚ' => 'Ⴚ', + 'ⴛ' => 'Ⴛ', + 'ⴜ' => 'Ⴜ', + 'ⴝ' => 'Ⴝ', + 'ⴞ' => 'Ⴞ', + 'ⴟ' => 'Ⴟ', + 'ⴠ' => 'Ⴠ', + 'ⴡ' => 'Ⴡ', + 'ⴢ' => 'Ⴢ', + 'ⴣ' => 'Ⴣ', + 'ⴤ' => 'Ⴤ', + 'ⴥ' => 'Ⴥ', + 'ⴧ' => 'Ⴧ', + 'ⴭ' => 'Ⴭ', + 'ꙁ' => 'Ꙁ', + 'ꙃ' => 'Ꙃ', + 'ꙅ' => 'Ꙅ', + 'ꙇ' => 'Ꙇ', + 'ꙉ' => 'Ꙉ', + 'ꙋ' => 'Ꙋ', + 'ꙍ' => 'Ꙍ', + 'ꙏ' => 'Ꙏ', + 'ꙑ' => 'Ꙑ', + 'ꙓ' => 'Ꙓ', + 'ꙕ' => 'Ꙕ', + 'ꙗ' => 'Ꙗ', + 'ꙙ' => 'Ꙙ', + 'ꙛ' => 'Ꙛ', + 'ꙝ' => 'Ꙝ', + 'ꙟ' => 'Ꙟ', + 'ꙡ' => 'Ꙡ', + 'ꙣ' => 'Ꙣ', + 'ꙥ' => 'Ꙥ', + 'ꙧ' => 'Ꙧ', + 'ꙩ' => 'Ꙩ', + 'ꙫ' => 'Ꙫ', + 'ꙭ' => 'Ꙭ', + 'ꚁ' => 'Ꚁ', + 'ꚃ' => 'Ꚃ', + 'ꚅ' => 'Ꚅ', + 'ꚇ' => 'Ꚇ', + 'ꚉ' => 'Ꚉ', + 'ꚋ' => 'Ꚋ', + 'ꚍ' => 'Ꚍ', + 'ꚏ' => 'Ꚏ', + 'ꚑ' => 'Ꚑ', + 'ꚓ' => 'Ꚓ', + 'ꚕ' => 'Ꚕ', + 'ꚗ' => 'Ꚗ', + 'ꚙ' => 'Ꚙ', + 'ꚛ' => 'Ꚛ', + 'ꜣ' => 'Ꜣ', + 'ꜥ' => 'Ꜥ', + 'ꜧ' => 'Ꜧ', + 'ꜩ' => 'Ꜩ', + 'ꜫ' => 'Ꜫ', + 'ꜭ' => 'Ꜭ', + 'ꜯ' => 'Ꜯ', + 'ꜳ' => 'Ꜳ', + 'ꜵ' => 'Ꜵ', + 'ꜷ' => 'Ꜷ', + 'ꜹ' => 'Ꜹ', + 'ꜻ' => 'Ꜻ', + 'ꜽ' => 'Ꜽ', + 'ꜿ' => 'Ꜿ', + 'ꝁ' => 'Ꝁ', + 'ꝃ' => 'Ꝃ', + 'ꝅ' => 'Ꝅ', + 'ꝇ' => 'Ꝇ', + 'ꝉ' => 'Ꝉ', + 'ꝋ' => 'Ꝋ', + 'ꝍ' => 'Ꝍ', + 'ꝏ' => 'Ꝏ', + 'ꝑ' => 'Ꝑ', + 'ꝓ' => 'Ꝓ', + 'ꝕ' => 'Ꝕ', + 'ꝗ' => 'Ꝗ', + 'ꝙ' => 'Ꝙ', + 'ꝛ' => 'Ꝛ', + 'ꝝ' => 'Ꝝ', + 'ꝟ' => 'Ꝟ', + 'ꝡ' => 'Ꝡ', + 'ꝣ' => 'Ꝣ', + 'ꝥ' => 'Ꝥ', + 'ꝧ' => 'Ꝧ', + 'ꝩ' => 'Ꝩ', + 'ꝫ' => 'Ꝫ', + 'ꝭ' => 'Ꝭ', + 'ꝯ' => 'Ꝯ', + 'ꝺ' => 'Ꝺ', + 'ꝼ' => 'Ꝼ', + 'ꝿ' => 'Ꝿ', + 'ꞁ' => 'Ꞁ', + 'ꞃ' => 'Ꞃ', + 'ꞅ' => 'Ꞅ', + 'ꞇ' => 'Ꞇ', + 'ꞌ' => 'Ꞌ', + 'ꞑ' => 'Ꞑ', + 'ꞓ' => 'Ꞓ', + 'ꞗ' => 'Ꞗ', + 'ꞙ' => 'Ꞙ', + 'ꞛ' => 'Ꞛ', + 'ꞝ' => 'Ꞝ', + 'ꞟ' => 'Ꞟ', + 'ꞡ' => 'Ꞡ', + 'ꞣ' => 'Ꞣ', + 'ꞥ' => 'Ꞥ', + 'ꞧ' => 'Ꞧ', + 'ꞩ' => 'Ꞩ', + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + '𐐨' => '𐐀', + '𐐩' => '𐐁', + '𐐪' => '𐐂', + '𐐫' => '𐐃', + '𐐬' => '𐐄', + '𐐭' => '𐐅', + '𐐮' => '𐐆', + '𐐯' => '𐐇', + '𐐰' => '𐐈', + '𐐱' => '𐐉', + '𐐲' => '𐐊', + '𐐳' => '𐐋', + '𐐴' => '𐐌', + '𐐵' => '𐐍', + '𐐶' => '𐐎', + '𐐷' => '𐐏', + '𐐸' => '𐐐', + '𐐹' => '𐐑', + '𐐺' => '𐐒', + '𐐻' => '𐐓', + '𐐼' => '𐐔', + '𐐽' => '𐐕', + '𐐾' => '𐐖', + '𐐿' => '𐐗', + '𐑀' => '𐐘', + '𐑁' => '𐐙', + '𐑂' => '𐐚', + '𐑃' => '𐐛', + '𐑄' => '𐐜', + '𐑅' => '𐐝', + '𐑆' => '𐐞', + '𐑇' => '𐐟', + '𐑈' => '𐐠', + '𐑉' => '𐐡', + '𐑊' => '𐐢', + '𐑋' => '𐐣', + '𐑌' => '𐐤', + '𐑍' => '𐐥', + '𐑎' => '𐐦', + '𐑏' => '𐐧', + '𑣀' => '𑢠', + '𑣁' => '𑢡', + '𑣂' => '𑢢', + '𑣃' => '𑢣', + '𑣄' => '𑢤', + '𑣅' => '𑢥', + '𑣆' => '𑢦', + '𑣇' => '𑢧', + '𑣈' => '𑢨', + '𑣉' => '𑢩', + '𑣊' => '𑢪', + '𑣋' => '𑢫', + '𑣌' => '𑢬', + '𑣍' => '𑢭', + '𑣎' => '𑢮', + '𑣏' => '𑢯', + '𑣐' => '𑢰', + '𑣑' => '𑢱', + '𑣒' => '𑢲', + '𑣓' => '𑢳', + '𑣔' => '𑢴', + '𑣕' => '𑢵', + '𑣖' => '𑢶', + '𑣗' => '𑢷', + '𑣘' => '𑢸', + '𑣙' => '𑢹', + '𑣚' => '𑢺', + '𑣛' => '𑢻', + '𑣜' => '𑢼', + '𑣝' => '𑢽', + '𑣞' => '𑢾', + '𑣟' => '𑢿', +); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php new file mode 100644 index 00000000..2fdcc5a6 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_strlen')) { + define('MB_CASE_UPPER', 0); + define('MB_CASE_LOWER', 1); + define('MB_CASE_TITLE', 2); + + function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } + function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } + function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } + function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } + function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } + function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } + function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } + function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } + function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } + function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } + function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } + function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } + function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } + function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } + function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } + function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } + function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } + function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } + function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } + function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } + function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } + function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } + function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } + function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } + function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } + function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } + function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } + function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } + function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } + function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } + function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } + function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } + function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } + function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } +} +if (!function_exists('mb_chr')) { + function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } + function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } + function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } +} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json new file mode 100644 index 00000000..50ea12f1 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -0,0 +1,34 @@ +{ + "name": "symfony/polyfill-mbstring", + "type": "library", + "description": "Symfony polyfill for the Mbstring extension", + "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + } +} diff --git a/view/index.html b/view/index.html deleted file mode 100644 index 3af63015..00000000 --- a/view/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/view/options-form.php b/view/options-form.php deleted file mode 100644 index c93bbf58..00000000 --- a/view/options-form.php +++ /dev/null @@ -1,285 +0,0 @@ -action = $action; - } - - public function display() - { - echo '
    '; - - foreach ($this->fieldsets as $fieldset) - { - if ($fieldset->block === true) { - echo '
    '; - } - echo '

    ' . $fieldset->getTitle() . '

    '; - - if ($fieldset->getDescription()) - echo '

    ' . $fieldset->getDescription() . '

    '; - - $options = $fieldset->getOptions(); - - if (!empty($options)) - { - echo ''; - - foreach ($options as $option) - $option->display(); - - echo '
    '; - } - if ($fieldset->block === true) { - echo '
    '; - } - } - submit_button(__('Save options', 'wp-mailjet')); - echo '
    '; - } - - public function addFieldset(WP_Mailjet_Options_Form_Fieldset $fieldset) - { - $this->fieldsets[] = $fieldset; - } - - public function setFieldsets($fieldsets) - { - $this->fieldsets = $fieldsets; - } - - public function getFieldsets() - { - return $this->fieldsets; - } -} - -class WP_Mailjet_Options_Form_Option -{ - protected $id; - protected $label; - protected $value; - protected $type; - protected $desc; - protected $required; - protected $options; - - public function __construct($id, $label, $type, $value = "", $desc="", $required = FALSE, $options = null, $disabled = FALSE) - { - $this->id = $id; - $this->label = $label; - $this->type = $type; - $this->value = $value; - - update_option($id, $value); - - $this->desc = $desc; - $this->required = $required; - $this->options = $options; - $this->disabled = $disabled; - } - - public function display() - { - if ($this->type == 'text' || $this->type == 'email') - { - echo ' - - - getRequired() ? 'required="required"' : '') . '> - '; - } - else if ($this->type == "checkbox") - { - echo ' - - ' . $this->getDesc() . ' - -
    - ' . $this->getLabel() . ' - -
    - - '; - } - elseif ($this->type == 'select') - { - $sel = ' - ' . $this->getDesc() . ' - -
    - ' . $this->getLabel() . ' - -
    - - '; - - echo $sel; - } - } - - public function setId($id) - { - $this->id = $id; - } - - public function getId() - { - return $this->id; - } - - public function setLabel($label) - { - $this->label = $label; - } - - public function getLabel() - { - return $this->label; - } - - public function setType($type) - { - $this->type = $type; - } - - public function getType() - { - return $this->type; - } - - public function setValue($value) - { - $this->value = $value; - update_option( $this->id, $value); - } - - public function getValue() - { - return get_option($this->getId()); - } - - public function setDesc($desc) - { - $this->desc = $desc; - } - - public function getDesc() - { - return $this->desc; - } - - public function setOptions($options) - { - $this->options = $options; - } - - public function getOptions() - { - return $this->options; - } - - public function setDisabled($disabled) - { - $this->disabled = $disabled; - } - - public function getDisabled() - { - return $this->disabled; - } - - public function setRequired($required) - { - $this->required = $required; - } - - public function getRequired() - { - return $this->required; - } -} - -class WP_Mailjet_Options_Form_Fieldset -{ - protected $title; - protected $options; - protected $description; - public $block = false; - - public function __construct($title, array $options, $description = "", $block = false) - { - $this->title = $title; - $this->options = $options; - $this->description = $description; - $this->block = $block; - } - - public function setDescription($description) - { - $this->description = $description; - } - - public function getDescription() - { - return $this->description; - } - - public function setOptions($options) - { - $this->options = $options; - } - - public function getOptions() - { - return $this->options; - } - - public function setTitle($title) - { - $this->title = $title; - } - - public function getTitle() - { - return $this->title; - } - - public function setBlock($block) - { - $this->block = $block; - } - - public function getBlock() - { - return $this->block; - } -} \ No newline at end of file diff --git a/wp-mailjet.php b/wp-mailjet.php index c4356603..73cf99ee 100755 --- a/wp-mailjet.php +++ b/wp-mailjet.php @@ -1,16 +1,29 @@

    '; - _e('Mailjet plugin requires PHP 5.3 to function properly. Please upgrade PHP', 'wp-mailjet'); - echo "

    "; -/* - if (isset($_GET['activate'])) { - unset($_GET['activate']); - } -*/ -} - - -# Check if the plugin is set up properly -if (get_option('mailjet_password') && get_option('mailjet_username')) { - global $phpmailer, $WPMailjet; - $MailjetApi = new WP_Mailjet_Api(get_option('mailjet_username'), get_option('mailjet_password')); - - if (!is_object($phpmailer) || !is_a($phpmailer, 'PHPMailer')) { - require_once ABSPATH . WPINC . '/class-phpmailer.php'; - require_once ABSPATH . WPINC . '/class-smtp.php'; - - $phpmailer = new PHPMailer(); - } - - $WPMailjet = new WP_Mailjet($MailjetApi, $phpmailer); - add_action('widgets_init', 'wp_mailjet_register_widgets'); -} elseif (get_option('mailjet_enabled') && (!get_option('mailjet_password') || !get_option('mailjet_username'))) { - // Display a notice that can be dismissed - add_action('admin_notices', 'wp_mailjet_admin_notice'); -} - -add_action('admin_init', 'wp_mailjet_notice_ignore'); - -function wp_mailjet_notice_ignore() -{ - global $current_user; - $user_id = $current_user->ID; - - // If user clicks to ignore the notice, add that to their user meta - if (isset($_GET['wp_mailjet_notice_ignore']) && '1' == $_GET['wp_mailjet_notice_ignore']) - add_user_meta($user_id, 'wp_mailjet_notice_ignore', 'true', TRUE); +// If this file is called directly, abort. +if (!defined('WPINC')) { + die; } +// Autoloading via composer +require_once __DIR__ . '/vendor/autoload.php'; -function wp_mailjet_admin_notice() -{ - global $current_user; - $user_id = $current_user->ID; - - // Check that the user hasn't already clicked to ignore the message - if (!get_user_meta($user_id, 'wp_mailjet_notice_ignore')) { - echo '

    '; - printf(__('The mailjet plugin is enabled but your credentials are not set. Please do so now to send your emails through Mailjet Hide Notice', 'wp-mailjet'), 'admin.php?page=wp_mailjet_options_top_menu?wp_mailjet_notice_ignore=1'); - echo "

    "; - } -} - - -/** - * Register Mailjet's widget - */ -function wp_mailjet_register_widgets() -{ - register_widget('WP_Mailjet_Subscribe_Widget'); -} +use Analog\Analog; +use MailjetPlugin\Includes\Mailjet; +use MailjetPlugin\Includes\MailjetActivator; +use MailjetPlugin\Includes\MailjetDeactivator; +use MailjetPlugin\Includes\MailjetSettings; +use MailjetPlugin\Includes\MailjetUpdate; +// Change the handler to any other if you need to. +//Analog::handler(\Analog\Handler\File::init(dirname(__FILE__) . '/logs.txt')); +Analog::handler(\Analog\Handler\ChromeLogger::init()); /** - * Display settings link on plugins page - * - * @param array $links - * @param string $file - * @return array + * Currently plugin version. */ -function mailjet_settings_link($links, $file) -{ - if ($file != plugin_basename(__FILE__)) - return $links; - - $settings_link = '' . __('Settings', 'wp-mailjet') . ''; +define('MAILJET_VERSION', '5.0.6'); - array_unshift($links, $settings_link); - return $links; -} - - -add_filter('plugin_action_links', 'mailjet_settings_link', 10, 2); +// Call the update to V5 logic +MailjetUpdate::updateToV5(); -/* Add additional custom field */ -add_action('show_user_profile', 'mailjet_show_extra_profile_fields'); -add_action('edit_user_profile', 'mailjet_show_extra_profile_fields'); -add_action('register_form', 'mailjet_show_extra_profile_fields'); -add_action('user_new_form', 'mailjet_show_extra_profile_fields'); - -function mailjet_show_extra_profile_fields($user) -{ - // If contact list is not selected, then do not show the extra fields - if (get_option('mailjet_auto_subscribe_list_id')) { - // Update the extra fields - if (is_object($user) && intval($user->ID) > 0) { - mailjet_subscribe_unsub_user_to_list(esc_attr(get_the_author_meta('mailjet_subscribe_ok', $user->ID)), $user->ID); - } - ?> - -
    -
    - ID; - - // Display the checkbox only for NOT-logged in users - if (!$user_id && get_option('mailjet_comment_authors_list_id')) { - ?> - -
    - comment_author_email, FILTER_SANITIZE_EMAIL); - $userId = filter_var($comment->user_id, FILTER_SANITIZE_NUMBER_INT); - - if (!mailjet_validate_email($authorEmail)) { - _e('Invalid email', 'wp-mailjet'); - die; - } - - $subscribe = filter_var($_POST['mailjet_comment_authors_subscribe_ok'], FILTER_SANITIZE_NUMBER_INT); - mailjet_subscribe_confirmation_from_comment_form($subscribe, $authorEmail); -} -function mailjet_validate_email($email) -{ - return (preg_match("/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/", $email) || - !preg_match("/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/", $email)) ? FALSE : TRUE; -} - /** - * Subscribe or unsubscribe a wordpress comment author in/from a Mailjet's contact list when the comment is saved + * The code that runs during plugin activation. + * This action is documented in includes/MailjetActivator.php */ -function mailjet_subscribe_unsub_comment_author_to_list($subscribe, $user_email) +function activate_mailjet() { - if (get_option('mailjet_password') && get_option('mailjet_username') && isset($user_email)) { - $MailjetApi = new WP_Mailjet_Api(get_option('mailjet_username'), get_option('mailjet_password')); - if ($subscribe && $list_id = get_option('mailjet_comment_authors_list_id')) { - // Add the user to a contact list - $contacts[] = array( - 'Email' => $user_email - ); - - $MailjetApi->addContact(array( - 'action' => 'addforce', - 'ListID' => $list_id, - 'contacts' => $contacts - )); - - echo '

    '; - echo sprintf(__("Thanks for subscribing with %s", 'wp-mailjet-subscription-widget'), $user_email); - echo '

    '; - } elseif (!$subscribe && $list_id = get_option('mailjet_comment_authors_list_id')) { - // Remove a user from a contact lists - $MailjetApi->removeContact(array( - 'Email' => $user_email, - 'ListID' => $list_id - )); - echo '

    '; - echo sprintf(__("The contact %s is unsubscribed", 'wp-mailjet-subscription-widget'), $user_email); - echo '

    '; - } - die(); - } + MailjetActivator::activate(); } - /** - * Set extra profile fields when the profile is saved + * The code that runs during plugin deactivation. + * This action is documented in includes/MailjetDeactivator.php */ -function mailjet_register_extra_fields($user_id, $password = "", $meta = array()) +function deactivate_mailjet() { - $subscribe = filter_var($_POST ['mailjet_subscribe_ok'], FILTER_SANITIZE_NUMBER_INT); - - update_user_meta($user_id, 'mailjet_subscribe_ok', $subscribe); - mailjet_subscribe_unsub_user_to_list($subscribe, $user_id); -} - -/** - * Email the collected widget data to the customer with a verification token - * @param void - * @return void - */ -function mailjet_subscribe_confirmation_from_comment_form($subscribe, $user_email) -{ - $error = empty($user_email) ? 'Email field is empty' : false; - if (false !== $error) { - _e($error, 'wp-mailjet-subscription-widget'); - die; - } - - if (!mailjet_validate_email($user_email)) { - _e('Invalid email', 'wp-mailjet-subscription-widget'); - die; - } - - $message = file_get_contents(dirname(__FILE__) . '/templates/confirm-subscription-email.php'); - $emailParams = array( - '__EMAIL_TITLE__' => __('Confirm your mailing list subscription', 'wp-mailjet-subscription-widget'), - '__EMAIL_HEADER__' => __('Please Confirm Your Subscription To', 'wp-mailjet-subscription-widget'), - '__WP_URL__' => sprintf('%s', get_home_url(), get_home_url()), - '__CONFIRM_URL__' => get_home_url() . '?subscribe=' . $subscribe . '&user_email=' . $user_email . '&mj_sub_comment_author_token=' . sha1($subscribe . $user_email), - '__CLICK_HERE__' => __('Click here to confirm', 'wp-mailjet-subscription-widget'), - '__COPY_PASTE_LINK__' => __('You may copy/paste this link into your browser:', 'wp-mailjet-subscription-widget'), - '__FROM_NAME__' => get_option('blogname'), - '__IGNORE__' => __('Did not ask to subscribe to this list? Or maybe you have changed your mind? Then simply ignore this email and you will not be subscribed', 'wp-mailjet-subscription-widget'), - '__THANKS__' => __('Thanks,', 'wp-mailjet-subscription-widget') - ); - foreach ($emailParams as $key => $value) { - $message = str_replace($key, $value, $message); - } - add_filter('wp_mail_content_type', create_function('', 'return "text/html"; ')); - wp_mail($_POST['email'], __('Subscription Confirmation', 'wp-mailjet-subscription-widget'), $message, - array('From: ' . get_option('blogname') . ' <' . get_option('admin_email') . '>')); + MailjetDeactivator::deactivate(); } +//register_activation_hook(__FILE__, 'activate_mailjet'); +//register_deactivation_hook(__FILE__, 'deactivate_mailjet'); /** - * Subscribe or unsubscribe a wordpress user (admin, editor, etc.) in/from a Mailjet's contact list when the profile is saved - */ -function mailjet_subscribe_unsub_user_to_list($subscribe, $user_id) -{ - if (get_option('mailjet_password') && get_option('mailjet_username')) { - $user = get_userdata($user_id); - $MailjetApi = new WP_Mailjet_Api(get_option('mailjet_username'), get_option('mailjet_password')); - - if ($subscribe && $list_id = get_option('mailjet_auto_subscribe_list_id')) { - // Add the user to a contact list - - $MailjetApi->createMetaContactProperty(array( - 'name' => 'wp_user_role', - 'dataType' => 'str' - )); - - $userInfo = get_userdata($user_id); - $userRoles = $userInfo->roles; - - if (!empty($userRoles[0])) { - $contactProperties['wp_user_role'] = $userRoles[0]; - } - $contacts[] = array( - 'Email' => (isset($_POST['email'])) ? $_POST['email'] : $user->data->user_email, - 'Properties' => $contactProperties - ); - - $MailjetApi->addContact(array( - 'action' => 'addforce', - 'ListID' => $list_id, - 'contacts' => $contacts - )); - - } elseif (!$subscribe && $list_id = get_option('mailjet_auto_subscribe_list_id')) { - // Remove a user from a contact lists - $MailjetApi->removeContact(array( - 'Email' => (isset($_POST['email'])) ? $_POST['email'] : $user->data->user_email, - 'ListID' => $list_id - )); - } - } -} - - -/** - * Update extra profile fields when the profile is saved + * Begins execution of the plugin. + * + * Since everything within the plugin is registered via hooks, + * then kicking off the plugin from this point in the file does + * not affect the page life cycle. + * + * @since 5.0.0 */ -function mailjet_my_save_extra_profile_fields($user_id) +function run_mailjet() { - if (!current_user_can('edit_user', $user_id)) - return FALSE; - - $subscribe = filter_var($_POST ['mailjet_subscribe_ok'], FILTER_SANITIZE_NUMBER_INT); - - update_user_meta($user_id, 'mailjet_subscribe_ok', $subscribe); - mailjet_subscribe_unsub_user_to_list($subscribe, $user_id); + $plugin = new Mailjet(); + $plugin->run(); } -load_plugin_textdomain('wp-mailjet', FALSE, dirname(plugin_basename(__FILE__)) . '/i18n'); -load_plugin_textdomain('wp-mailjet-subscription-widget', FALSE, dirname(plugin_basename(__FILE__)) . '/i18n'); - -if (!empty($_GET['mj_sub_comment_author_token']) - && - $_GET['mj_sub_comment_author_token'] == sha1($_GET['subscribe'] . str_ireplace(' ', '+', $_GET['user_email']))) { - mailjet_subscribe_unsub_comment_author_to_list($_GET['subscribe'], str_ireplace(' ', '+', $_GET['user_email'])); -} +run_mailjet();