├── .gitignore ├── LICENSE ├── README.md ├── app ├── config │ ├── config.php │ ├── development.php │ └── services.php ├── controllers │ ├── AddressController.php │ ├── CustomerController.php │ └── UserController.php ├── database │ └── sample-database.sqlite ├── entities │ └── UserEntity.php ├── helpers │ └── base.php ├── libraries │ ├── API │ │ └── SecureController.php │ ├── Authentication │ │ ├── Local.php │ │ └── UserProfile.php │ ├── Formatters │ │ ├── Currency.php │ │ ├── Date.php │ │ ├── Identity.php │ │ └── Telephone.php │ ├── MessageBag │ │ ├── MessageBag.php │ │ └── adapters │ │ │ └── JSON.php │ └── Security │ │ └── SecurityService.php ├── models │ ├── Addresses.php │ ├── Customers.php │ └── Users.php └── routes │ ├── collections │ └── addresses.php │ └── routeLoader.php ├── codeception.yml ├── composer.json ├── composer.lock ├── docker-compose.yml ├── docker ├── file_storage │ └── .gitignore ├── mariadb │ ├── data │ │ └── .gitignore │ └── maria.cnf ├── nginx │ ├── fastcgi_params │ ├── nginx.conf │ └── sites-available │ │ └── default └── php7 │ ├── cli │ └── php.ini │ ├── fpm │ ├── php.ini │ └── pool.d │ │ └── www.conf │ └── php-fpm.conf ├── index.html ├── public ├── favicon.ico ├── index.php └── test.php └── tests ├── _bootstrap.php ├── _support ├── AcceptanceTester.php ├── FunctionalTester.php ├── Helper │ ├── Acceptance.php │ ├── Functional.php │ └── Unit.php ├── UnitTester.php └── _generated │ ├── AcceptanceTesterActions.php │ ├── FunctionalTesterActions.php │ └── UnitTesterActions.php ├── acceptance.suite.yml ├── acceptance ├── AllQueriesActiveModelCept.php └── _bootstrap.php ├── functional.suite.yml ├── functional └── _bootstrap.php ├── unit.suite.yml └── unit └── _bootstrap.php /.gitignore: -------------------------------------------------------------------------------- 1 | # zend studio files..if that is your ide 2 | /.buildpath 3 | /.project 4 | /.settings/ 5 | 6 | 7 | 8 | # what are these? 9 | /deployment.properties 10 | /deployment.xml 11 | 12 | #phpstorm 13 | /.idea 14 | 15 | #composer directory 16 | /vendor/ 17 | 18 | # ignore codeception files 19 | /tests/_data/* 20 | /tests/_output/* 21 | /tests/_support/* 22 | 23 | # ingnore mysql schema builder bak file 24 | *.bak 25 | 26 | # ignore gedit temp files 27 | *.*~ 28 | 29 | # Octocat's Idea's on what to ignore 30 | # Compiled source # 31 | ################### 32 | *.com 33 | *.class 34 | *.dll 35 | *.exe 36 | *.o 37 | *.so 38 | 39 | # Packages # 40 | ############ 41 | # it's better to unpack these files and commit the raw source 42 | # git has its own built in compression methods 43 | *.7z 44 | *.dmg 45 | *.gz 46 | *.iso 47 | *.jar 48 | *.rar 49 | *.tar 50 | *.zip 51 | 52 | # Logs and databases # 53 | ###################### 54 | *.log 55 | *.sql 56 | # *.sqlite 57 | 58 | # OS generated files # 59 | ###################### 60 | .DS_Store 61 | .DS_Store? 62 | ._* 63 | .Spotlight-V100 64 | .Trashes 65 | ehthumbs.db 66 | Thumbs.db 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phalcon_rest 2 | Use Phalcon and {JSON:API} to make your own server 3 | 4 | This project demonstrates how to use the [Phalcon + {JSON:API}](https://github.com/gte451f/phalcon-json-api-package) project. 5 | It is a working example that pulls a the composer package into a Phalcon application. 6 | The demo app is backed by a sqlite database but MySQL or MariaDB also work well. 7 | 8 | To see a more full featured application that runs on the Phalcon + {JSON:API} package, visit [smores-api](https://github.com/gte451f/smores-api). 9 | 10 | For help installing this application refer to the [Install Page](https://github.com/gte451f/phalcon-json-api/wiki/How-to-run-this-app%3F) in the [wiki](https://github.com/gte451f/phalcon-json-api/wiki). 11 | 12 | For more information on the package itself, visit the [Phalcon + {JSON:API}](https://github.com/gte451f/phalcon-json-api-package) project. 13 | -------------------------------------------------------------------------------- /app/config/config.php: -------------------------------------------------------------------------------- 1 | 'dash', 16 | 17 | // how are your existing database field name formatted? 18 | // possible values are camel, snake, dash 19 | // none means perform no processing on the incoming values 20 | 'propertyFormatFrom' => 'snake', 21 | 22 | // would also accept any FOLDER name in Result\Adapters 23 | 'outputFormat' => 'JsonApi', 24 | 25 | // enable security for controllers marked as secure? 26 | 'security' => false, 27 | ]; 28 | 29 | // override production config by environment config 30 | $override_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . APPLICATION_ENV . '.php'; 31 | 32 | // log the correct combination of config values 33 | $config = file_exists($override_path) ? 34 | array_merge_recursive_replace($config, require(APPLICATION_ENV . '.php')) : 35 | $config; 36 | 37 | // the api currently expect an array, not the phalcon config object 38 | return $config; -------------------------------------------------------------------------------- /app/config/development.php: -------------------------------------------------------------------------------- 1 | [ 12 | // where to store cache related files 13 | 'cacheDir' => '/tmp/', 14 | // FQDN 15 | 'publicUrl' => 'http://localhost:8080', 16 | // probably the same FQDN 17 | 'corsOrigin' => 'https://localhost:8080', 18 | // should the api return additional meta data and enable additional server logging? 19 | 'debugApp' => true, 20 | // where should system temp files go? 21 | 'tempDir' => '/tmp/', 22 | // where should app generated logs be stored? 23 | 'loggingDir' => '/tmp/', 24 | // what is the path after the FQDN? 25 | 'baseUri' => '/v1/' 26 | ], 27 | // user local database for easy example 28 | 'dbname' => APPLICATION_PATH . 'database/sample-database.sqlite', 29 | 30 | // used as a system wide prefix to all file storage paths 31 | 'fileStorage' => [ 32 | 'basePath' => '/file_storage/' 33 | ] 34 | ]; -------------------------------------------------------------------------------- /app/config/services.php: -------------------------------------------------------------------------------- 1 | setShared('messageBag', function () { 25 | return new \PhalconRest\Libraries\MessageBag\MessageBag(); 26 | }); 27 | 28 | // hold messages that should be returned to the client 29 | $di->setShared('registry', function () { 30 | return new \Phalcon\Registry(); 31 | }); 32 | 33 | // load a security service applied to select controllers 34 | $di->setShared('securityService', function () use ($config) { 35 | return new \PhalconRest\Libraries\Security\SecurityService(); 36 | }); 37 | 38 | /** 39 | * load an authenticator w/ local adapter 40 | * called "auth" since the API expects a service of this name for subsequent token checks 41 | */ 42 | $di->setShared('auth', function ($type = 'Employee') use ($config) { 43 | $adapter = new \PhalconRest\Libraries\Authentication\Local(); 44 | $profile = new \PhalconRest\Libraries\Authentication\UserProfile(); 45 | $auth = new \PhalconRest\Authentication\Authenticator($adapter, $profile); 46 | $auth->userNameFieldName = 'email'; 47 | return $auth; 48 | }); 49 | 50 | 51 | 52 | /** 53 | * Database setup. 54 | */ 55 | $di->set('db', function () use ($config, $di) { 56 | // config the event and log services 57 | $eventsManager = new EventsManager(); 58 | $fileName = date("d_m_y"); 59 | $logger = new FileLogger("/tmp/$fileName.log"); 60 | // $registry = new \Phalcon\Registry(); 61 | $registry = $di->get('registry'); 62 | $registry->dbCount = 0; 63 | 64 | // Listen all the database events 65 | $eventsManager->attach('db', function ($event, $connection) use ($logger, $registry) { 66 | if ($event->getType() == 'beforeQuery') { 67 | $count = $registry->dbCount; 68 | $count++; 69 | $registry->dbCount = $count; 70 | 71 | // $logger->log($connection->getSQLStatement(), Logger::INFO); 72 | } 73 | }); 74 | 75 | // $connection = new Connection($config['database']); 76 | $connection = new Phalcon\Db\Adapter\Pdo\Sqlite($config); 77 | 78 | // Assign the eventsManager to the db adapter instance 79 | $connection->setEventsManager($eventsManager); 80 | 81 | return $connection; 82 | }); -------------------------------------------------------------------------------- /app/controllers/AddressController.php: -------------------------------------------------------------------------------- 1 | checkUserPermissions()) { 25 | // This is bad. Throw a 500. Responses should always be objects. 26 | throw new HTTPException("Resource not available.", 404, array( 27 | 'dev' => 'You do not have access to the requested resource.', 28 | 'code' => '7427655276527529' 29 | )); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /app/libraries/Authentication/Local.php: -------------------------------------------------------------------------------- 1 | userName; 38 | $profile['token'] = $this->token; 39 | return parent::getResult($profile); 40 | } 41 | } -------------------------------------------------------------------------------- /app/libraries/Formatters/Currency.php: -------------------------------------------------------------------------------- 1 | 11) { 39 | $phone = substr($phone, 0, 11); 40 | } 41 | 42 | // Do we want to convert phone numbers with letters to their number 43 | // equivalent? 44 | // Samples are: 1-800-TERMINIX, 1-800-FLOWERS, 1-800-Petmeds 45 | if ($convert == true && !is_numeric($phone)) { 46 | $replace = array( 47 | '2' => array( 48 | 'a', 49 | 'b', 50 | 'c' 51 | ), 52 | '3' => array( 53 | 'd', 54 | 'e', 55 | 'f' 56 | ), 57 | '4' => array( 58 | 'g', 59 | 'h', 60 | 'i' 61 | ), 62 | '5' => array( 63 | 'j', 64 | 'k', 65 | 'l' 66 | ), 67 | '6' => array( 68 | 'm', 69 | 'n', 70 | 'o' 71 | ), 72 | '7' => array( 73 | 'p', 74 | 'q', 75 | 'r', 76 | 's' 77 | ), 78 | '8' => array( 79 | 't', 80 | 'u', 81 | 'v' 82 | ), 83 | '9' => array( 84 | 'w', 85 | 'x', 86 | 'y', 87 | 'z' 88 | ) 89 | ); 90 | 91 | // Replace each letter with a number 92 | // Notice this is case insensitive with the str_ireplace instead of 93 | // str_replace 94 | foreach ($replace as $digit => $letters) { 95 | $phone = str_ireplace($letters, $digit, $phone); 96 | } 97 | } 98 | 99 | $length = strlen($phone); 100 | // Perform phone number formatting here 101 | switch ($length) { 102 | case 7: 103 | 104 | // Format: xxx-xxxx 105 | return preg_replace("/([0-9a-zA-Z]{3})([0-9a-zA-Z]{4})/", "$1-$2", $phone); 106 | case 10: 107 | 108 | // Format: (xxx) xxx-xxxx 109 | return preg_replace("/([0-9a-zA-Z]{3})([0-9a-zA-Z]{3})([0-9a-zA-Z]{4})/", "($1) $2-$3", $phone); 110 | case 11: 111 | 112 | // Format: x(xxx) xxx-xxxx 113 | return preg_replace("/([0-9a-zA-Z]{1})([0-9a-zA-Z]{3})([0-9a-zA-Z]{3})([0-9a-zA-Z]{4})/", 114 | "$1($2) $3-$4", $phone); 115 | default: 116 | 117 | // Return original phone if not 7, 10 or 11 digits long 118 | return $OriginalPhone; 119 | } 120 | } 121 | } -------------------------------------------------------------------------------- /app/libraries/MessageBag/MessageBag.php: -------------------------------------------------------------------------------- 1 | - '; 21 | 22 | /** 23 | * 24 | * @param string $message 25 | */ 26 | public function set($message) 27 | { 28 | $this->messageList[] = $message; 29 | } 30 | 31 | /** 32 | * 33 | * @return multitype: 34 | */ 35 | public function get() 36 | { 37 | return $this->messageList; 38 | } 39 | 40 | /** 41 | * 42 | * @return string 43 | */ 44 | public function getString() 45 | { 46 | return implode($this->glue, $this->messageList); 47 | } 48 | } -------------------------------------------------------------------------------- /app/libraries/MessageBag/adapters/JSON.php: -------------------------------------------------------------------------------- 1 | singularName = 'Address'; 54 | $this->belongsTo("user_id", Users::class, "id", ['alias' => 'Users']); 55 | } 56 | 57 | /** 58 | * this would normally be auto detected but 59 | * must extend to account for unusual singular/plural naming 60 | * 61 | * (non-PHPdoc) 62 | * 63 | * @see \PhalconRest\API\BaseModel::getModelName() 64 | */ 65 | public function getModelName($type = 'plural') 66 | { 67 | if ($type == 'plural') { 68 | return 'Addresses'; 69 | } else { 70 | return 'Address'; 71 | } 72 | } 73 | 74 | /** 75 | * this would normally be auto detected but 76 | * must extend to account for unusual singular/plural naming 77 | * 78 | * (non-PHPdoc) 79 | * 80 | * @see \PhalconRest\API\BaseModel::getTableName() 81 | */ 82 | public function getTableName($type = 'plural') 83 | { 84 | if ($type == 'plural') { 85 | return 'addresses'; 86 | } else { 87 | return 'address'; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/models/Customers.php: -------------------------------------------------------------------------------- 1 | hasOne("user_id", Users::class, "id", ['alias' => 'Users']); 42 | $this->hasMany("user_d", Addresses::class, "user_id", ['alias' => 'Addresses']); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/models/Users.php: -------------------------------------------------------------------------------- 1 | blockColumns = array( 42 | 'secret' 43 | ); 44 | $this->hasMany("id", Addresses::class, "user_id", ['alias' => 'Addresses']); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/routes/collections/addresses.php: -------------------------------------------------------------------------------- 1 | setPrefix('/v1/addresses') 15 | ->setHandler('\PhalconRest\Controllers\AddressController') 16 | ->setLazy(true); 17 | 18 | $routes->options('/', 'optionsBase'); 19 | $routes->options('/{id}', 'optionsOne'); 20 | $routes->get('/', 'get'); 21 | $routes->head('/', 'get'); 22 | $routes->post('/', 'post'); 23 | $routes->get('/{id:[0-9]+}', 'getOne'); 24 | $routes->head('/{id:[0-9]+}', 'getOne'); 25 | $routes->delete('/{id:[0-9]+}', 'delete'); 26 | $routes->put('/{id:[0-9]+}', 'put'); 27 | $routes->patch('/{id:[0-9]+}', 'patch'); 28 | 29 | return $routes; 30 | }); -------------------------------------------------------------------------------- /app/routes/routeLoader.php: -------------------------------------------------------------------------------- 1 | 'AddressController', 8 | 'customers' => 'CustomerController', 9 | 'users' => 'UserController' 10 | ]; 11 | 12 | /** 13 | * routeLoader loads a set of Phalcon Mvc\Micro\Collections from 14 | * the collections directory. 15 | * 16 | * php files in the collections directory must return Collection objects only. 17 | */ 18 | return call_user_func(function () use ($genericRoutes) { 19 | $collections = []; 20 | $collectionFiles = scandir(dirname(__FILE__) . '/collections'); 21 | 22 | foreach ($collectionFiles as $collectionFile) { 23 | $pathinfo = pathinfo($collectionFile); 24 | // Only include php files 25 | if ($pathinfo['extension'] === 'php' and $pathinfo['basename'] !== 'generic_route.php') { 26 | // The collection files return their collection objects, so mount 27 | // them directly into the router. 28 | $collections[] = include(dirname(__FILE__) . '/collections/' . $collectionFile); 29 | } 30 | } 31 | 32 | // process generic routes here 33 | foreach ($genericRoutes as $endPoint => $controllerName) { 34 | 35 | // define the generic routes here 36 | $routes = new \Phalcon\Mvc\Micro\Collection(); 37 | $routes->setPrefix('/v1/' . $endPoint) 38 | ->setHandler('\\PhalconRest\\Controllers\\' . $controllerName) 39 | ->setLazy(true); 40 | 41 | $routes->options('/', 'optionsBase'); 42 | $routes->options('/{id}', 'optionsOne'); 43 | $routes->get('/', 'get'); 44 | $routes->head('/', 'get'); 45 | $routes->post('/', 'post'); 46 | $routes->get('/{id:[0-9]+}', 'getOne'); 47 | $routes->head('/{id:[0-9]+}', 'getOne'); 48 | $routes->delete('/{id:[0-9]+}', 'delete'); 49 | $routes->put('/{id:[0-9]+}', 'put'); 50 | $routes->patch('/{id:[0-9]+}', 'patch'); 51 | $collections[] = $routes; 52 | } 53 | 54 | return $collections; 55 | }); 56 | 57 | -------------------------------------------------------------------------------- /codeception.yml: -------------------------------------------------------------------------------- 1 | actor: Tester 2 | paths: 3 | tests: tests 4 | log: tests/_output 5 | data: tests/_data 6 | support: tests/_support 7 | envs: tests/_envs 8 | settings: 9 | bootstrap: _bootstrap.php 10 | colors: true 11 | memory_limit: 1024M 12 | extensions: 13 | enabled: 14 | - Codeception\Extension\RunFailed 15 | modules: 16 | config: 17 | Db: 18 | dsn: '' 19 | user: '' 20 | password: '' 21 | dump: tests/_data/dump.sql 22 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "GPL-3.0", 3 | "config": { 4 | "secure-http": true 5 | }, 6 | "require": { 7 | "php": ">=7.0", 8 | "gte451f/phalcon-json-api-package": "dev-dev" 9 | }, 10 | "require-dev": { 11 | "codeception/codeception": "*", 12 | "flow/jsonpath": "dev-master", 13 | "phalcon/devtools": "^3.0" 14 | }, 15 | "scripts": { 16 | "post-install-cmd": "composer dumpautoload -o", 17 | "post-update-cmd": "composer dumpautoload -o", 18 | "clear": "rm -rf /tmp/*", 19 | "test": "codecept run", 20 | "test-debug": "codecept run --debug", 21 | "test-api": "codecept run acceptance", 22 | "test-api-debug": "codecept run acceptance --debug" 23 | } 24 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | web: 2 | image: gte451f/nginx 3 | volumes: 4 | - .:/var/www 5 | - ./docker/nginx/sites-available/default:/etc/nginx/sites-available/default 6 | - ./docker/nginx/fastcgi_params:/etc/nginx/fastcgi_params 7 | - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf 8 | ports: 9 | - "8080:80" 10 | links: 11 | - php 12 | 13 | php: 14 | image: gte451f/php:7.0 15 | volumes: 16 | - .:/var/www 17 | - ./docker/file_storage:/file_storage/ 18 | - ./docker/php7/fpm/php.ini:/etc/php/7.0/fpm/php.ini 19 | - ./docker/php7/cli/php.ini:/etc/php/7.0/cli/php.ini 20 | - ./docker/php7/php-fpm.conf:/etc/php/7.0/fpm/php-fpm.conf 21 | - ./docker/php7/fpm/pool.d:/etc/php/7.0/fpm/pool.d 22 | 23 | -------------------------------------------------------------------------------- /docker/file_storage/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /docker/mariadb/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /docker/mariadb/maria.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | # 3 | # * InnoDB 4 | # 5 | # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. 6 | # Read the manual for more InnoDB related options. There are many! 7 | default_storage_engine = InnoDB 8 | 9 | # you can't just change log file size, requires special procedure 10 | innodb_log_file_size = 48M 11 | 12 | innodb_buffer_pool_size = 256M 13 | innodb_log_buffer_size = 8M 14 | innodb_file_per_table = 1 15 | innodb_file_format = Barracuda 16 | innodb_open_files = 400 17 | innodb_io_capacity = 400 18 | innodb_flush_method = O_DIRECT 19 | 20 | 21 | # New default charsets 22 | character_set_server=utf8 23 | collation_server=utf8_general_ci 24 | -------------------------------------------------------------------------------- /docker/nginx/fastcgi_params: -------------------------------------------------------------------------------- 1 | fastcgi_param QUERY_STRING $query_string; 2 | fastcgi_param REQUEST_METHOD $request_method; 3 | fastcgi_param CONTENT_TYPE $content_type; 4 | fastcgi_param CONTENT_LENGTH $content_length; 5 | 6 | fastcgi_param SCRIPT_FILENAME $request_filename; 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param REQUEST_URI $request_uri; 9 | fastcgi_param DOCUMENT_URI $document_uri; 10 | fastcgi_param DOCUMENT_ROOT $document_root; 11 | fastcgi_param SERVER_PROTOCOL $server_protocol; 12 | 13 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 14 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 15 | 16 | fastcgi_param REMOTE_ADDR $remote_addr; 17 | fastcgi_param REMOTE_PORT $remote_port; 18 | fastcgi_param SERVER_ADDR $server_addr; 19 | fastcgi_param SERVER_PORT $server_port; 20 | fastcgi_param SERVER_NAME $server_name; 21 | 22 | fastcgi_param HTTPS $https if_not_empty; 23 | 24 | # PHP only, required if PHP was built with --enable-force-cgi-redirect 25 | fastcgi_param REDIRECT_STATUS 200; 26 | 27 | # added to increase default timeout 28 | fastcgi_read_timeout 300; 29 | proxy_read_timeout 300; 30 | -------------------------------------------------------------------------------- /docker/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | 3 | 4 | # Determines whether nginx should become a daemon. Mainly used during development. 5 | daemon off; 6 | 7 | # This number should be, at maximum, the number of CPU cores on your system. 8 | # (since nginx doesn't benefit from more than one worker per CPU.) 9 | worker_processes 1; 10 | 11 | 12 | pid /run/nginx.pid; 13 | 14 | 15 | events { 16 | 17 | # Determines how many clients will be served by each worker process. 18 | # (Max clients = worker_connections * worker_processes) 19 | # "Max clients" is also limited by the number of socket connections available on the system (~64k) 20 | worker_connections 4096; 21 | 22 | 23 | # Accept as many connections as possible, after nginx gets notification about a new connection. 24 | # May flood worker_connections, if that option is set too low. 25 | multi_accept on; 26 | 27 | # essential for linux, optmized to serve many clients with each thread 28 | use epoll; 29 | 30 | } 31 | 32 | http { 33 | 34 | ## 35 | # Basic Settings 36 | ## 37 | 38 | # Sendfile copies data between one FD and other from within the kernel. 39 | # More efficient than read() + write(), since the requires transferring data to and from the user space. 40 | sendfile on; 41 | 42 | # Tcp_nopush causes nginx to attempt to send its HTTP response head in one packet, 43 | # instead of using partial frames. This is useful for prepending headers before calling sendfile, 44 | # or for throughput optimization. 45 | tcp_nopush on; 46 | 47 | # don't buffer data-sends (disable Nagle algorithm). Good for sending frequent small bursts of data in real time. 48 | tcp_nodelay on; 49 | 50 | 51 | # Timeout for keep-alive connections. Server will close connections after this time. 52 | keepalive_timeout 30; 53 | 54 | send_timeout 15; 55 | 56 | # allow the server to close the connection after a client stops responding. Frees up socket-associated memory. 57 | reset_timedout_connection on; 58 | 59 | # send the client a "request timed out" if the body is not loaded by this time. Default 60. 60 | client_body_timeout 15; 61 | 62 | # adding this variable to increase max upload file size 63 | client_max_body_size 150m; 64 | 65 | client_body_buffer_size 1m; 66 | client_header_timeout 15; 67 | 68 | types_hash_max_size 2048; 69 | 70 | server_tokens off; 71 | 72 | # Caches information about open FDs, freqently accessed files. 73 | # Changing this setting, in my environment, brought performance up from 560k req/sec, to 904k req/sec. 74 | # I recommend using some varient of these options, though not the specific values listed below. 75 | open_file_cache max=200000 inactive=20s; 76 | open_file_cache_valid 30s; 77 | open_file_cache_min_uses 2; 78 | open_file_cache_errors on; 79 | 80 | 81 | # server_names_hash_bucket_size 64; 82 | # server_name_in_redirect off; 83 | 84 | include /etc/nginx/mime.types; 85 | default_type application/octet-stream; 86 | 87 | ## 88 | # Logging Settings 89 | ## 90 | 91 | log_format main '$remote_addr - $remote_user [$time_local] $status ' 92 | '"$request" $body_bytes_sent "$http_referer" ' 93 | '"$http_user_agent" "$http_x_forwarded_for" ($request_time)'; 94 | 95 | # Buffer log writes to speed up IO, or disable them altogether 96 | access_log /var/log/nginx/access.log main; 97 | error_log /var/log/nginx/error.log; 98 | 99 | ## 100 | # Gzip Settings 101 | ## 102 | 103 | gzip on; 104 | gzip_http_version 1.1; 105 | gzip_disable "msie6"; 106 | gzip_vary on; 107 | gzip_proxied any; 108 | gzip_comp_level 8; 109 | gzip_buffers 16 8k; 110 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 111 | 112 | ## 113 | # nginx-naxsi config 114 | ## 115 | # Uncomment it if you installed nginx-naxsi 116 | ## 117 | 118 | #include /etc/nginx/naxsi_core.rules; 119 | 120 | ## 121 | # nginx-passenger config 122 | ## 123 | # Uncomment it if you installed nginx-passenger 124 | ## 125 | 126 | #passenger_root /usr; 127 | #passenger_ruby /usr/bin/ruby; 128 | 129 | ## 130 | # Virtual Host Configs 131 | ## 132 | 133 | include /etc/nginx/conf.d/*.conf; 134 | include /etc/nginx/sites-enabled/*; 135 | } 136 | -------------------------------------------------------------------------------- /docker/nginx/sites-available/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen [::]:80; 4 | 5 | server_name localhost; 6 | 7 | root /var/www/public; 8 | index index.php index.html index.htm; 9 | 10 | # used since we upload via xhr 11 | client_max_body_size 100M; 12 | 13 | # disable logging extra files 14 | location ~* \.(gif|jpg|jpeg|ico|png|js|woff|css) { 15 | access_log off; 16 | } 17 | 18 | # block access to hidden files and folders like .git .svn .htaccess 19 | location ~ /\. { 20 | access_log off; log_not_found off; deny all; 21 | } 22 | 23 | location @phalcon { 24 | rewrite ^(.+)$ /index.php?_url=$1 last; 25 | } 26 | 27 | location / { 28 | index index.php; 29 | try_files $uri $uri/ @phalcon; 30 | } 31 | 32 | error_page 404 /404.html; 33 | error_page 500 502 503 504 /50x.html; 34 | location = /50x.html { 35 | root /usr/share/nginx/html; 36 | } 37 | 38 | location ~ \.php$ { 39 | try_files $uri =404; 40 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 41 | fastcgi_pass php:9000; 42 | fastcgi_index index.php; 43 | include fastcgi_params; 44 | fastcgi_param PATH_INFO $fastcgi_path_info; 45 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 46 | 47 | #-------------------------------------------- 48 | # fix bad gateway 502 errors 49 | #-------------------------------------------- 50 | fastcgi_buffers 10 4k; 51 | fastcgi_buffer_size 16k; 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /docker/php7/cli/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ;;;;;;;;;;;;;;;;;;; 4 | ; About php.ini ; 5 | ;;;;;;;;;;;;;;;;;;; 6 | ; PHP's initialization file, generally called php.ini, is responsible for 7 | ; configuring many of the aspects of PHP's behavior. 8 | 9 | ; PHP attempts to find and load this configuration from a number of locations. 10 | ; The following is a summary of its search order: 11 | ; 1. SAPI module specific location. 12 | ; 2. The PHPRC environment variable. (As of PHP 5.2.0) 13 | ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) 14 | ; 4. Current working directory (except CLI) 15 | ; 5. The web server's directory (for SAPI modules), or directory of PHP 16 | ; (otherwise in Windows) 17 | ; 6. The directory from the --with-config-file-path compile time option, or the 18 | ; Windows directory (C:\windows or C:\winnt) 19 | ; See the PHP docs for more specific information. 20 | ; http://php.net/configuration.file 21 | 22 | ; The syntax of the file is extremely simple. Whitespace and lines 23 | ; beginning with a semicolon are silently ignored (as you probably guessed). 24 | ; Section headers (e.g. [Foo]) are also silently ignored, even though 25 | ; they might mean something in the future. 26 | 27 | ; Directives following the section heading [PATH=/www/mysite] only 28 | ; apply to PHP files in the /www/mysite directory. Directives 29 | ; following the section heading [HOST=www.example.com] only apply to 30 | ; PHP files served from www.example.com. Directives set in these 31 | ; special sections cannot be overridden by user-defined INI files or 32 | ; at runtime. Currently, [PATH=] and [HOST=] sections only work under 33 | ; CGI/FastCGI. 34 | ; http://php.net/ini.sections 35 | 36 | ; Directives are specified using the following syntax: 37 | ; directive = value 38 | ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. 39 | ; Directives are variables used to configure PHP or PHP extensions. 40 | ; There is no name validation. If PHP can't find an expected 41 | ; directive because it is not set or is mistyped, a default value will be used. 42 | 43 | ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one 44 | ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression 45 | ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a 46 | ; previously set variable or directive (e.g. ${foo}) 47 | 48 | ; Expressions in the INI file are limited to bitwise operators and parentheses: 49 | ; | bitwise OR 50 | ; ^ bitwise XOR 51 | ; & bitwise AND 52 | ; ~ bitwise NOT 53 | ; ! boolean NOT 54 | 55 | ; Boolean flags can be turned on using the values 1, On, True or Yes. 56 | ; They can be turned off using the values 0, Off, False or No. 57 | 58 | ; An empty string can be denoted by simply not writing anything after the equal 59 | ; sign, or by using the None keyword: 60 | 61 | ; foo = ; sets foo to an empty string 62 | ; foo = None ; sets foo to an empty string 63 | ; foo = "None" ; sets foo to the string 'None' 64 | 65 | ; If you use constants in your value, and these constants belong to a 66 | ; dynamically loaded extension (either a PHP extension or a Zend extension), 67 | ; you may only use these constants *after* the line that loads the extension. 68 | 69 | ;;;;;;;;;;;;;;;;;;; 70 | ; About this file ; 71 | ;;;;;;;;;;;;;;;;;;; 72 | ; PHP comes packaged with two INI files. One that is recommended to be used 73 | ; in production environments and one that is recommended to be used in 74 | ; development environments. 75 | 76 | ; php.ini-production contains settings which hold security, performance and 77 | ; best practices at its core. But please be aware, these settings may break 78 | ; compatibility with older or less security conscience applications. We 79 | ; recommending using the production ini in production and testing environments. 80 | 81 | ; php.ini-development is very similar to its production variant, except it is 82 | ; much more verbose when it comes to errors. We recommend using the 83 | ; development version only in development environments, as errors shown to 84 | ; application users can inadvertently leak otherwise secure information. 85 | 86 | ; This is php.ini-production INI file. 87 | 88 | ;;;;;;;;;;;;;;;;;;; 89 | ; Quick Reference ; 90 | ;;;;;;;;;;;;;;;;;;; 91 | ; The following are all the settings which are different in either the production 92 | ; or development versions of the INIs with respect to PHP's default behavior. 93 | ; Please see the actual settings later in the document for more details as to why 94 | ; we recommend these changes in PHP's behavior. 95 | 96 | ; display_errors 97 | ; Default Value: On 98 | ; Development Value: On 99 | ; Production Value: Off 100 | 101 | ; display_startup_errors 102 | ; Default Value: Off 103 | ; Development Value: On 104 | ; Production Value: Off 105 | 106 | ; error_reporting 107 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 108 | ; Development Value: E_ALL 109 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 110 | 111 | ; html_errors 112 | ; Default Value: On 113 | ; Development Value: On 114 | ; Production value: On 115 | 116 | ; log_errors 117 | ; Default Value: Off 118 | ; Development Value: On 119 | ; Production Value: On 120 | 121 | ; max_input_time 122 | ; Default Value: -1 (Unlimited) 123 | ; Development Value: 60 (60 seconds) 124 | ; Production Value: 60 (60 seconds) 125 | 126 | ; output_buffering 127 | ; Default Value: Off 128 | ; Development Value: 4096 129 | ; Production Value: 4096 130 | 131 | ; register_argc_argv 132 | ; Default Value: On 133 | ; Development Value: Off 134 | ; Production Value: Off 135 | 136 | ; request_order 137 | ; Default Value: None 138 | ; Development Value: "GP" 139 | ; Production Value: "GP" 140 | 141 | ; session.gc_divisor 142 | ; Default Value: 100 143 | ; Development Value: 1000 144 | ; Production Value: 1000 145 | 146 | ; session.hash_bits_per_character 147 | ; Default Value: 4 148 | ; Development Value: 5 149 | ; Production Value: 5 150 | 151 | ; short_open_tag 152 | ; Default Value: On 153 | ; Development Value: Off 154 | ; Production Value: Off 155 | 156 | ; track_errors 157 | ; Default Value: Off 158 | ; Development Value: On 159 | ; Production Value: Off 160 | 161 | ; url_rewriter.tags 162 | ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" 163 | ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 164 | ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 165 | 166 | ; variables_order 167 | ; Default Value: "EGPCS" 168 | ; Development Value: "GPCS" 169 | ; Production Value: "GPCS" 170 | 171 | ;;;;;;;;;;;;;;;;;;;; 172 | ; php.ini Options ; 173 | ;;;;;;;;;;;;;;;;;;;; 174 | ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" 175 | ;user_ini.filename = ".user.ini" 176 | 177 | ; To disable this feature set this option to empty value 178 | ;user_ini.filename = 179 | 180 | ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) 181 | ;user_ini.cache_ttl = 300 182 | 183 | ;;;;;;;;;;;;;;;;;;;; 184 | ; Language Options ; 185 | ;;;;;;;;;;;;;;;;;;;; 186 | 187 | ; Enable the PHP scripting language engine under Apache. 188 | ; http://php.net/engine 189 | engine = On 190 | 191 | ; This directive determines whether or not PHP will recognize code between 192 | ; tags as PHP source which should be processed as such. It is 193 | ; generally recommended that should be used and that this feature 194 | ; should be disabled, as enabling it may result in issues when generating XML 195 | ; documents, however this remains supported for backward compatibility reasons. 196 | ; Note that this directive does not control the tags. 205 | ; http://php.net/asp-tags 206 | asp_tags = Off 207 | 208 | ; The number of significant digits displayed in floating point numbers. 209 | ; http://php.net/precision 210 | precision = 14 211 | 212 | ; Output buffering is a mechanism for controlling how much output data 213 | ; (excluding headers and cookies) PHP should keep internally before pushing that 214 | ; data to the client. If your application's output exceeds this setting, PHP 215 | ; will send that data in chunks of roughly the size you specify. 216 | ; Turning on this setting and managing its maximum buffer size can yield some 217 | ; interesting side-effects depending on your application and web server. 218 | ; You may be able to send headers and cookies after you've already sent output 219 | ; through print or echo. You also may see performance benefits if your server is 220 | ; emitting less packets due to buffered output versus PHP streaming the output 221 | ; as it gets it. On production servers, 4096 bytes is a good setting for performance 222 | ; reasons. 223 | ; Note: Output buffering can also be controlled via Output Buffering Control 224 | ; functions. 225 | ; Possible Values: 226 | ; On = Enabled and buffer is unlimited. (Use with caution) 227 | ; Off = Disabled 228 | ; Integer = Enables the buffer and sets its maximum size in bytes. 229 | ; Note: This directive is hardcoded to Off for the CLI SAPI 230 | ; Default Value: Off 231 | ; Development Value: 4096 232 | ; Production Value: 4096 233 | ; http://php.net/output-buffering 234 | output_buffering = 4096 235 | 236 | ; You can redirect all of the output of your scripts to a function. For 237 | ; example, if you set output_handler to "mb_output_handler", character 238 | ; encoding will be transparently converted to the specified encoding. 239 | ; Setting any output handler automatically turns on output buffering. 240 | ; Note: People who wrote portable scripts should not depend on this ini 241 | ; directive. Instead, explicitly set the output handler using ob_start(). 242 | ; Using this ini directive may cause problems unless you know what script 243 | ; is doing. 244 | ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" 245 | ; and you cannot use both "ob_gzhandler" and "zlib.output_compression". 246 | ; Note: output_handler must be empty if this is set 'On' !!!! 247 | ; Instead you must use zlib.output_handler. 248 | ; http://php.net/output-handler 249 | ;output_handler = 250 | 251 | ; Transparent output compression using the zlib library 252 | ; Valid values for this option are 'off', 'on', or a specific buffer size 253 | ; to be used for compression (default is 4KB) 254 | ; Note: Resulting chunk size may vary due to nature of compression. PHP 255 | ; outputs chunks that are few hundreds bytes each as a result of 256 | ; compression. If you prefer a larger chunk size for better 257 | ; performance, enable output_buffering in addition. 258 | ; Note: You need to use zlib.output_handler instead of the standard 259 | ; output_handler, or otherwise the output will be corrupted. 260 | ; http://php.net/zlib.output-compression 261 | zlib.output_compression = Off 262 | 263 | ; http://php.net/zlib.output-compression-level 264 | ;zlib.output_compression_level = -1 265 | 266 | ; You cannot specify additional output handlers if zlib.output_compression 267 | ; is activated here. This setting does the same as output_handler but in 268 | ; a different order. 269 | ; http://php.net/zlib.output-handler 270 | ;zlib.output_handler = 271 | 272 | ; Implicit flush tells PHP to tell the output layer to flush itself 273 | ; automatically after every output block. This is equivalent to calling the 274 | ; PHP function flush() after each and every call to print() or echo() and each 275 | ; and every HTML block. Turning this option on has serious performance 276 | ; implications and is generally recommended for debugging purposes only. 277 | ; http://php.net/implicit-flush 278 | ; Note: This directive is hardcoded to On for the CLI SAPI 279 | implicit_flush = Off 280 | 281 | ; The unserialize callback function will be called (with the undefined class' 282 | ; name as parameter), if the unserializer finds an undefined class 283 | ; which should be instantiated. A warning appears if the specified function is 284 | ; not defined, or if the function doesn't include/implement the missing class. 285 | ; So only set this entry, if you really want to implement such a 286 | ; callback-function. 287 | unserialize_callback_func = 288 | 289 | ; When floats & doubles are serialized store serialize_precision significant 290 | ; digits after the floating point. The default value ensures that when floats 291 | ; are decoded with unserialize, the data will remain the same. 292 | serialize_precision = 17 293 | 294 | ; open_basedir, if set, limits all file operations to the defined directory 295 | ; and below. This directive makes most sense if used in a per-directory 296 | ; or per-virtualhost web server configuration file. 297 | ; http://php.net/open-basedir 298 | ;open_basedir = 299 | 300 | ; This directive allows you to disable certain functions for security reasons. 301 | ; It receives a comma-delimited list of function names. 302 | ; http://php.net/disable-functions 303 | disable_functions = 304 | 305 | ; This directive allows you to disable certain classes for security reasons. 306 | ; It receives a comma-delimited list of class names. 307 | ; http://php.net/disable-classes 308 | disable_classes = 309 | 310 | ; Colors for Syntax Highlighting mode. Anything that's acceptable in 311 | ; would work. 312 | ; http://php.net/syntax-highlighting 313 | ;highlight.string = #DD0000 314 | ;highlight.comment = #FF9900 315 | ;highlight.keyword = #007700 316 | ;highlight.default = #0000BB 317 | ;highlight.html = #000000 318 | 319 | ; If enabled, the request will be allowed to complete even if the user aborts 320 | ; the request. Consider enabling it if executing long requests, which may end up 321 | ; being interrupted by the user or a browser timing out. PHP's default behavior 322 | ; is to disable this feature. 323 | ; http://php.net/ignore-user-abort 324 | ;ignore_user_abort = On 325 | 326 | ; Determines the size of the realpath cache to be used by PHP. This value should 327 | ; be increased on systems where PHP opens many files to reflect the quantity of 328 | ; the file operations performed. 329 | ; http://php.net/realpath-cache-size 330 | ;realpath_cache_size = 16k 331 | 332 | ; Duration of time, in seconds for which to cache realpath information for a given 333 | ; file or directory. For systems with rarely changing files, consider increasing this 334 | ; value. 335 | ; http://php.net/realpath-cache-ttl 336 | ;realpath_cache_ttl = 120 337 | 338 | ; Enables or disables the circular reference collector. 339 | ; http://php.net/zend.enable-gc 340 | zend.enable_gc = On 341 | 342 | ; If enabled, scripts may be written in encodings that are incompatible with 343 | ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such 344 | ; encodings. To use this feature, mbstring extension must be enabled. 345 | ; Default: Off 346 | ;zend.multibyte = Off 347 | 348 | ; Allows to set the default encoding for the scripts. This value will be used 349 | ; unless "declare(encoding=...)" directive appears at the top of the script. 350 | ; Only affects if zend.multibyte is set. 351 | ; Default: "" 352 | ;zend.script_encoding = 353 | 354 | ;;;;;;;;;;;;;;;;; 355 | ; Miscellaneous ; 356 | ;;;;;;;;;;;;;;;;; 357 | 358 | ; Decides whether PHP may expose the fact that it is installed on the server 359 | ; (e.g. by adding its signature to the Web server header). It is no security 360 | ; threat in any way, but it makes it possible to determine whether you use PHP 361 | ; on your server or not. 362 | ; http://php.net/expose-php 363 | expose_php = On 364 | 365 | ;;;;;;;;;;;;;;;;;;; 366 | ; Resource Limits ; 367 | ;;;;;;;;;;;;;;;;;;; 368 | 369 | ; Maximum execution time of each script, in seconds 370 | ; http://php.net/max-execution-time 371 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 372 | max_execution_time = 30 373 | 374 | ; Maximum amount of time each script may spend parsing request data. It's a good 375 | ; idea to limit this time on productions servers in order to eliminate unexpectedly 376 | ; long running scripts. 377 | ; Note: This directive is hardcoded to -1 for the CLI SAPI 378 | ; Default Value: -1 (Unlimited) 379 | ; Development Value: 60 (60 seconds) 380 | ; Production Value: 60 (60 seconds) 381 | ; http://php.net/max-input-time 382 | max_input_time = 60 383 | 384 | ; Maximum input variable nesting level 385 | ; http://php.net/max-input-nesting-level 386 | ;max_input_nesting_level = 64 387 | 388 | ; How many GET/POST/COOKIE input variables may be accepted 389 | ; max_input_vars = 1000 390 | 391 | ; Maximum amount of memory a script may consume (128MB) 392 | ; http://php.net/memory-limit 393 | memory_limit = -1 394 | 395 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 396 | ; Error handling and logging ; 397 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 398 | 399 | ; This directive informs PHP of which errors, warnings and notices you would like 400 | ; it to take action for. The recommended way of setting values for this 401 | ; directive is through the use of the error level constants and bitwise 402 | ; operators. The error level constants are below here for convenience as well as 403 | ; some common settings and their meanings. 404 | ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT 405 | ; those related to E_NOTICE and E_STRICT, which together cover best practices and 406 | ; recommended coding standards in PHP. For performance reasons, this is the 407 | ; recommend error reporting setting. Your production server shouldn't be wasting 408 | ; resources complaining about best practices and coding standards. That's what 409 | ; development servers and development settings are for. 410 | ; Note: The php.ini-development file has this setting as E_ALL. This 411 | ; means it pretty much reports everything which is exactly what you want during 412 | ; development and early testing. 413 | ; 414 | ; Error Level Constants: 415 | ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) 416 | ; E_ERROR - fatal run-time errors 417 | ; E_RECOVERABLE_ERROR - almost fatal run-time errors 418 | ; E_WARNING - run-time warnings (non-fatal errors) 419 | ; E_PARSE - compile-time parse errors 420 | ; E_NOTICE - run-time notices (these are warnings which often result 421 | ; from a bug in your code, but it's possible that it was 422 | ; intentional (e.g., using an uninitialized variable and 423 | ; relying on the fact it is automatically initialized to an 424 | ; empty string) 425 | ; E_STRICT - run-time notices, enable to have PHP suggest changes 426 | ; to your code which will ensure the best interoperability 427 | ; and forward compatibility of your code 428 | ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup 429 | ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's 430 | ; initial startup 431 | ; E_COMPILE_ERROR - fatal compile-time errors 432 | ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) 433 | ; E_USER_ERROR - user-generated error message 434 | ; E_USER_WARNING - user-generated warning message 435 | ; E_USER_NOTICE - user-generated notice message 436 | ; E_DEPRECATED - warn about code that will not work in future versions 437 | ; of PHP 438 | ; E_USER_DEPRECATED - user-generated deprecation warnings 439 | ; 440 | ; Common Values: 441 | ; E_ALL (Show all errors, warnings and notices including coding standards.) 442 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices) 443 | ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) 444 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 445 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 446 | ; Development Value: E_ALL 447 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 448 | ; http://php.net/error-reporting 449 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 450 | 451 | ; This directive controls whether or not and where PHP will output errors, 452 | ; notices and warnings too. Error output is very useful during development, but 453 | ; it could be very dangerous in production environments. Depending on the code 454 | ; which is triggering the error, sensitive information could potentially leak 455 | ; out of your application such as database usernames and passwords or worse. 456 | ; For production environments, we recommend logging errors rather than 457 | ; sending them to STDOUT. 458 | ; Possible Values: 459 | ; Off = Do not display any errors 460 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 461 | ; On or stdout = Display errors to STDOUT 462 | ; Default Value: On 463 | ; Development Value: On 464 | ; Production Value: Off 465 | ; http://php.net/display-errors 466 | display_errors = Off 467 | 468 | ; The display of errors which occur during PHP's startup sequence are handled 469 | ; separately from display_errors. PHP's default behavior is to suppress those 470 | ; errors from clients. Turning the display of startup errors on can be useful in 471 | ; debugging configuration problems. We strongly recommend you 472 | ; set this to 'off' for production servers. 473 | ; Default Value: Off 474 | ; Development Value: On 475 | ; Production Value: Off 476 | ; http://php.net/display-startup-errors 477 | display_startup_errors = Off 478 | 479 | ; Besides displaying errors, PHP can also log errors to locations such as a 480 | ; server-specific log, STDERR, or a location specified by the error_log 481 | ; directive found below. While errors should not be displayed on productions 482 | ; servers they should still be monitored and logging is a great way to do that. 483 | ; Default Value: Off 484 | ; Development Value: On 485 | ; Production Value: On 486 | ; http://php.net/log-errors 487 | log_errors = On 488 | 489 | ; Set maximum length of log_errors. In error_log information about the source is 490 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 491 | ; http://php.net/log-errors-max-len 492 | log_errors_max_len = 1024 493 | 494 | ; Do not log repeated messages. Repeated errors must occur in same file on same 495 | ; line unless ignore_repeated_source is set true. 496 | ; http://php.net/ignore-repeated-errors 497 | ignore_repeated_errors = Off 498 | 499 | ; Ignore source of message when ignoring repeated messages. When this setting 500 | ; is On you will not log errors with repeated messages from different files or 501 | ; source lines. 502 | ; http://php.net/ignore-repeated-source 503 | ignore_repeated_source = Off 504 | 505 | ; If this parameter is set to Off, then memory leaks will not be shown (on 506 | ; stdout or in the log). This has only effect in a debug compile, and if 507 | ; error reporting includes E_WARNING in the allowed list 508 | ; http://php.net/report-memleaks 509 | report_memleaks = On 510 | 511 | ; This setting is on by default. 512 | ;report_zend_debug = 0 513 | 514 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 515 | ; to On can assist in debugging and is appropriate for development servers. It should 516 | ; however be disabled on production servers. 517 | ; Default Value: Off 518 | ; Development Value: On 519 | ; Production Value: Off 520 | ; http://php.net/track-errors 521 | track_errors = Off 522 | 523 | ; Turn off normal error reporting and emit XML-RPC error XML 524 | ; http://php.net/xmlrpc-errors 525 | ;xmlrpc_errors = 0 526 | 527 | ; An XML-RPC faultCode 528 | ;xmlrpc_error_number = 0 529 | 530 | ; When PHP displays or logs an error, it has the capability of formatting the 531 | ; error message as HTML for easier reading. This directive controls whether 532 | ; the error message is formatted as HTML or not. 533 | ; Note: This directive is hardcoded to Off for the CLI SAPI 534 | ; Default Value: On 535 | ; Development Value: On 536 | ; Production value: On 537 | ; http://php.net/html-errors 538 | html_errors = On 539 | 540 | ; If html_errors is set to On *and* docref_root is not empty, then PHP 541 | ; produces clickable error messages that direct to a page describing the error 542 | ; or function causing the error in detail. 543 | ; You can download a copy of the PHP manual from http://php.net/docs 544 | ; and change docref_root to the base URL of your local copy including the 545 | ; leading '/'. You must also specify the file extension being used including 546 | ; the dot. PHP's default behavior is to leave these settings empty, in which 547 | ; case no links to documentation are generated. 548 | ; Note: Never use this feature for production boxes. 549 | ; http://php.net/docref-root 550 | ; Examples 551 | ;docref_root = "/phpmanual/" 552 | 553 | ; http://php.net/docref-ext 554 | ;docref_ext = .html 555 | 556 | ; String to output before an error message. PHP's default behavior is to leave 557 | ; this setting blank. 558 | ; http://php.net/error-prepend-string 559 | ; Example: 560 | ;error_prepend_string = "" 561 | 562 | ; String to output after an error message. PHP's default behavior is to leave 563 | ; this setting blank. 564 | ; http://php.net/error-append-string 565 | ; Example: 566 | ;error_append_string = "" 567 | 568 | ; Log errors to specified file. PHP's default behavior is to leave this value 569 | ; empty. 570 | ; http://php.net/error-log 571 | ; Example: 572 | ;error_log = php_errors.log 573 | ; Log errors to syslog (Event Log on Windows). 574 | ;error_log = syslog 575 | 576 | ;windows.show_crt_warning 577 | ; Default value: 0 578 | ; Development value: 0 579 | ; Production value: 0 580 | 581 | ;;;;;;;;;;;;;;;;; 582 | ; Data Handling ; 583 | ;;;;;;;;;;;;;;;;; 584 | 585 | ; The separator used in PHP generated URLs to separate arguments. 586 | ; PHP's default setting is "&". 587 | ; http://php.net/arg-separator.output 588 | ; Example: 589 | ;arg_separator.output = "&" 590 | 591 | ; List of separator(s) used by PHP to parse input URLs into variables. 592 | ; PHP's default setting is "&". 593 | ; NOTE: Every character in this directive is considered as separator! 594 | ; http://php.net/arg-separator.input 595 | ; Example: 596 | ;arg_separator.input = ";&" 597 | 598 | ; This directive determines which super global arrays are registered when PHP 599 | ; starts up. G,P,C,E & S are abbreviations for the following respective super 600 | ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty 601 | ; paid for the registration of these arrays and because ENV is not as commonly 602 | ; used as the others, ENV is not recommended on productions servers. You 603 | ; can still get access to the environment variables through getenv() should you 604 | ; need to. 605 | ; Default Value: "EGPCS" 606 | ; Development Value: "GPCS" 607 | ; Production Value: "GPCS"; 608 | ; http://php.net/variables-order 609 | variables_order = "GPCS" 610 | 611 | ; This directive determines which super global data (G,P & C) should be 612 | ; registered into the super global array REQUEST. If so, it also determines 613 | ; the order in which that data is registered. The values for this directive 614 | ; are specified in the same manner as the variables_order directive, 615 | ; EXCEPT one. Leaving this value empty will cause PHP to use the value set 616 | ; in the variables_order directive. It does not mean it will leave the super 617 | ; globals array REQUEST empty. 618 | ; Default Value: None 619 | ; Development Value: "GP" 620 | ; Production Value: "GP" 621 | ; http://php.net/request-order 622 | request_order = "GP" 623 | 624 | ; This directive determines whether PHP registers $argv & $argc each time it 625 | ; runs. $argv contains an array of all the arguments passed to PHP when a script 626 | ; is invoked. $argc contains an integer representing the number of arguments 627 | ; that were passed when the script was invoked. These arrays are extremely 628 | ; useful when running scripts from the command line. When this directive is 629 | ; enabled, registering these variables consumes CPU cycles and memory each time 630 | ; a script is executed. For performance reasons, this feature should be disabled 631 | ; on production servers. 632 | ; Note: This directive is hardcoded to On for the CLI SAPI 633 | ; Default Value: On 634 | ; Development Value: Off 635 | ; Production Value: Off 636 | ; http://php.net/register-argc-argv 637 | register_argc_argv = Off 638 | 639 | ; When enabled, the ENV, REQUEST and SERVER variables are created when they're 640 | ; first used (Just In Time) instead of when the script starts. If these 641 | ; variables are not used within a script, having this directive on will result 642 | ; in a performance gain. The PHP directive register_argc_argv must be disabled 643 | ; for this directive to have any affect. 644 | ; http://php.net/auto-globals-jit 645 | auto_globals_jit = On 646 | 647 | ; Whether PHP will read the POST data. 648 | ; This option is enabled by default. 649 | ; Most likely, you won't want to disable this option globally. It causes $_POST 650 | ; and $_FILES to always be empty; the only way you will be able to read the 651 | ; POST data will be through the php://input stream wrapper. This can be useful 652 | ; to proxy requests or to process the POST data in a memory efficient fashion. 653 | ; http://php.net/enable-post-data-reading 654 | ;enable_post_data_reading = Off 655 | 656 | ; Maximum size of POST data that PHP will accept. 657 | ; Its value may be 0 to disable the limit. It is ignored if POST data reading 658 | ; is disabled through enable_post_data_reading. 659 | ; http://php.net/post-max-size 660 | post_max_size = 8M 661 | 662 | ; Automatically add files before PHP document. 663 | ; http://php.net/auto-prepend-file 664 | auto_prepend_file = 665 | 666 | ; Automatically add files after PHP document. 667 | ; http://php.net/auto-append-file 668 | auto_append_file = 669 | 670 | ; By default, PHP will output a media type using the Content-Type header. To 671 | ; disable this, simply set it to be empty. 672 | ; 673 | ; PHP's built-in default media type is set to text/html. 674 | ; http://php.net/default-mimetype 675 | default_mimetype = "text/html" 676 | 677 | ; PHP's default character set is set to UTF-8. 678 | ; http://php.net/default-charset 679 | default_charset = "UTF-8" 680 | 681 | ; PHP internal character encoding is set to empty. 682 | ; If empty, default_charset is used. 683 | ; http://php.net/internal-encoding 684 | ;internal_encoding = 685 | 686 | ; PHP input character encoding is set to empty. 687 | ; If empty, default_charset is used. 688 | ; http://php.net/input-encoding 689 | ;input_encoding = 690 | 691 | ; PHP output character encoding is set to empty. 692 | ; If empty, default_charset is used. 693 | ; mbstring or iconv output handler is used. 694 | ; See also output_buffer. 695 | ; http://php.net/output-encoding 696 | ;output_encoding = 697 | 698 | ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is 699 | ; to disable this feature and it will be removed in a future version. 700 | ; If post reading is disabled through enable_post_data_reading, 701 | ; $HTTP_RAW_POST_DATA is *NOT* populated. 702 | ; http://php.net/always-populate-raw-post-data 703 | always_populate_raw_post_data = -1 704 | 705 | ;;;;;;;;;;;;;;;;;;;;;;;;; 706 | ; Paths and Directories ; 707 | ;;;;;;;;;;;;;;;;;;;;;;;;; 708 | 709 | ; UNIX: "/path1:/path2" 710 | ;include_path = ".:/usr/share/php" 711 | ; 712 | ; Windows: "\path1;\path2" 713 | ;include_path = ".;c:\php\includes" 714 | ; 715 | ; PHP's default setting for include_path is ".;/path/to/php/pear" 716 | ; http://php.net/include-path 717 | 718 | ; The root of the PHP pages, used only if nonempty. 719 | ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root 720 | ; if you are running php as a CGI under any web server (other than IIS) 721 | ; see documentation for security issues. The alternate is to use the 722 | ; cgi.force_redirect configuration below 723 | ; http://php.net/doc-root 724 | doc_root = 725 | 726 | ; The directory under which PHP opens the script using /~username used only 727 | ; if nonempty. 728 | ; http://php.net/user-dir 729 | user_dir = 730 | 731 | ; Directory in which the loadable extensions (modules) reside. 732 | ; http://php.net/extension-dir 733 | ; extension_dir = "./" 734 | ; On windows: 735 | ; extension_dir = "ext" 736 | 737 | ; Directory where the temporary files should be placed. 738 | ; Defaults to the system default (see sys_get_temp_dir) 739 | ; sys_temp_dir = "/tmp" 740 | 741 | ; Whether or not to enable the dl() function. The dl() function does NOT work 742 | ; properly in multithreaded servers, such as IIS or Zeus, and is automatically 743 | ; disabled on them. 744 | ; http://php.net/enable-dl 745 | enable_dl = Off 746 | 747 | ; cgi.force_redirect is necessary to provide security running PHP as a CGI under 748 | ; most web servers. Left undefined, PHP turns this on by default. You can 749 | ; turn it off here AT YOUR OWN RISK 750 | ; **You CAN safely turn this off for IIS, in fact, you MUST.** 751 | ; http://php.net/cgi.force-redirect 752 | ;cgi.force_redirect = 1 753 | 754 | ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with 755 | ; every request. PHP's default behavior is to disable this feature. 756 | ;cgi.nph = 1 757 | 758 | ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 759 | ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP 760 | ; will look for to know it is OK to continue execution. Setting this variable MAY 761 | ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. 762 | ; http://php.net/cgi.redirect-status-env 763 | ;cgi.redirect_status_env = 764 | 765 | ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's 766 | ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok 767 | ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting 768 | ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting 769 | ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts 770 | ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. 771 | ; http://php.net/cgi.fix-pathinfo 772 | ;cgi.fix_pathinfo=1 773 | 774 | ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate 775 | ; security tokens of the calling client. This allows IIS to define the 776 | ; security context that the request runs under. mod_fastcgi under Apache 777 | ; does not currently support this feature (03/17/2002) 778 | ; Set to 1 if running under IIS. Default is zero. 779 | ; http://php.net/fastcgi.impersonate 780 | ;fastcgi.impersonate = 1 781 | 782 | ; Disable logging through FastCGI connection. PHP's default behavior is to enable 783 | ; this feature. 784 | ;fastcgi.logging = 0 785 | 786 | ; cgi.rfc2616_headers configuration option tells PHP what type of headers to 787 | ; use when sending HTTP response code. If set to 0, PHP sends Status: header that 788 | ; is supported by Apache. When this option is set to 1, PHP will send 789 | ; RFC2616 compliant header. 790 | ; Default is zero. 791 | ; http://php.net/cgi.rfc2616-headers 792 | ;cgi.rfc2616_headers = 0 793 | 794 | ;;;;;;;;;;;;;;;; 795 | ; File Uploads ; 796 | ;;;;;;;;;;;;;;;; 797 | 798 | ; Whether to allow HTTP file uploads. 799 | ; http://php.net/file-uploads 800 | file_uploads = On 801 | 802 | ; Temporary directory for HTTP uploaded files (will use system default if not 803 | ; specified). 804 | ; http://php.net/upload-tmp-dir 805 | ;upload_tmp_dir = 806 | 807 | ; Maximum allowed size for uploaded files. 808 | ; http://php.net/upload-max-filesize 809 | upload_max_filesize = 2M 810 | 811 | ; Maximum number of files that can be uploaded via a single request 812 | max_file_uploads = 20 813 | 814 | ;;;;;;;;;;;;;;;;;; 815 | ; Fopen wrappers ; 816 | ;;;;;;;;;;;;;;;;;; 817 | 818 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 819 | ; http://php.net/allow-url-fopen 820 | allow_url_fopen = On 821 | 822 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 823 | ; http://php.net/allow-url-include 824 | allow_url_include = Off 825 | 826 | ; Define the anonymous ftp password (your email address). PHP's default setting 827 | ; for this is empty. 828 | ; http://php.net/from 829 | ;from="john@doe.com" 830 | 831 | ; Define the User-Agent string. PHP's default setting for this is empty. 832 | ; http://php.net/user-agent 833 | ;user_agent="PHP" 834 | 835 | ; Default timeout for socket based streams (seconds) 836 | ; http://php.net/default-socket-timeout 837 | default_socket_timeout = 60 838 | 839 | ; If your scripts have to deal with files from Macintosh systems, 840 | ; or you are running on a Mac and need to deal with files from 841 | ; unix or win32 systems, setting this flag will cause PHP to 842 | ; automatically detect the EOL character in those files so that 843 | ; fgets() and file() will work regardless of the source of the file. 844 | ; http://php.net/auto-detect-line-endings 845 | ;auto_detect_line_endings = Off 846 | 847 | ;;;;;;;;;;;;;;;;;;;;;; 848 | ; Dynamic Extensions ; 849 | ;;;;;;;;;;;;;;;;;;;;;; 850 | 851 | ; If you wish to have an extension loaded automatically, use the following 852 | ; syntax: 853 | ; 854 | ; extension=modulename.extension 855 | ; 856 | ; For example, on Windows: 857 | ; 858 | ; extension=msql.dll 859 | ; 860 | ; ... or under UNIX: 861 | ; 862 | ; extension=msql.so 863 | ; 864 | ; ... or with a path: 865 | ; 866 | ; extension=/path/to/extension/msql.so 867 | ; 868 | ; If you only provide the name of the extension, PHP will look for it in its 869 | ; default extension directory. 870 | ; 871 | 872 | ;;;;;;;;;;;;;;;;;;; 873 | ; Module Settings ; 874 | ;;;;;;;;;;;;;;;;;;; 875 | 876 | [CLI Server] 877 | ; Whether the CLI web server uses ANSI color coding in its terminal output. 878 | cli_server.color = On 879 | 880 | [Date] 881 | ; Defines the default timezone used by the date functions 882 | ; http://php.net/date.timezone 883 | ;date.timezone = 884 | 885 | ; http://php.net/date.default-latitude 886 | ;date.default_latitude = 31.7667 887 | 888 | ; http://php.net/date.default-longitude 889 | ;date.default_longitude = 35.2333 890 | 891 | ; http://php.net/date.sunrise-zenith 892 | ;date.sunrise_zenith = 90.583333 893 | 894 | ; http://php.net/date.sunset-zenith 895 | ;date.sunset_zenith = 90.583333 896 | 897 | [filter] 898 | ; http://php.net/filter.default 899 | ;filter.default = unsafe_raw 900 | 901 | ; http://php.net/filter.default-flags 902 | ;filter.default_flags = 903 | 904 | [iconv] 905 | ; Use of this INI entry is deprecated, use global input_encoding instead. 906 | ; If empty, default_charset or input_encoding or iconv.input_encoding is used. 907 | ; The precedence is: default_charset < intput_encoding < iconv.input_encoding 908 | ;iconv.input_encoding = 909 | 910 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 911 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 912 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 913 | ;iconv.internal_encoding = 914 | 915 | ; Use of this INI entry is deprecated, use global output_encoding instead. 916 | ; If empty, default_charset or output_encoding or iconv.output_encoding is used. 917 | ; The precedence is: default_charset < output_encoding < iconv.output_encoding 918 | ; To use an output encoding conversion, iconv's output handler must be set 919 | ; otherwise output encoding conversion cannot be performed. 920 | ;iconv.output_encoding = 921 | 922 | [intl] 923 | ;intl.default_locale = 924 | ; This directive allows you to produce PHP errors when some error 925 | ; happens within intl functions. The value is the level of the error produced. 926 | ; Default is 0, which does not produce any errors. 927 | ;intl.error_level = E_WARNING 928 | 929 | [sqlite3] 930 | ;sqlite3.extension_dir = 931 | 932 | [Pcre] 933 | ;PCRE library backtracking limit. 934 | ; http://php.net/pcre.backtrack-limit 935 | ;pcre.backtrack_limit=100000 936 | 937 | ;PCRE library recursion limit. 938 | ;Please note that if you set this value to a high number you may consume all 939 | ;the available process stack and eventually crash PHP (due to reaching the 940 | ;stack size limit imposed by the Operating System). 941 | ; http://php.net/pcre.recursion-limit 942 | ;pcre.recursion_limit=100000 943 | 944 | [Pdo] 945 | ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" 946 | ; http://php.net/pdo-odbc.connection-pooling 947 | ;pdo_odbc.connection_pooling=strict 948 | 949 | ;pdo_odbc.db2_instance_name 950 | 951 | [Pdo_mysql] 952 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 953 | ; http://php.net/pdo_mysql.cache_size 954 | pdo_mysql.cache_size = 2000 955 | 956 | ; Default socket name for local MySQL connects. If empty, uses the built-in 957 | ; MySQL defaults. 958 | ; http://php.net/pdo_mysql.default-socket 959 | pdo_mysql.default_socket= 960 | 961 | [Phar] 962 | ; http://php.net/phar.readonly 963 | ;phar.readonly = On 964 | 965 | ; http://php.net/phar.require-hash 966 | ;phar.require_hash = On 967 | 968 | ;phar.cache_list = 969 | 970 | [mail function] 971 | ; For Win32 only. 972 | ; http://php.net/smtp 973 | SMTP = localhost 974 | ; http://php.net/smtp-port 975 | smtp_port = 25 976 | 977 | ; For Win32 only. 978 | ; http://php.net/sendmail-from 979 | ;sendmail_from = me@example.com 980 | 981 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 982 | ; http://php.net/sendmail-path 983 | ;sendmail_path = 984 | 985 | ; Force the addition of the specified parameters to be passed as extra parameters 986 | ; to the sendmail binary. These parameters will always replace the value of 987 | ; the 5th parameter to mail(). 988 | ;mail.force_extra_parameters = 989 | 990 | ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 991 | mail.add_x_header = On 992 | 993 | ; The path to a log file that will log all mail() calls. Log entries include 994 | ; the full path of the script, line number, To address and headers. 995 | ;mail.log = 996 | ; Log mail to syslog (Event Log on Windows). 997 | ;mail.log = syslog 998 | 999 | [SQL] 1000 | ; http://php.net/sql.safe-mode 1001 | sql.safe_mode = Off 1002 | 1003 | [ODBC] 1004 | ; http://php.net/odbc.default-db 1005 | ;odbc.default_db = Not yet implemented 1006 | 1007 | ; http://php.net/odbc.default-user 1008 | ;odbc.default_user = Not yet implemented 1009 | 1010 | ; http://php.net/odbc.default-pw 1011 | ;odbc.default_pw = Not yet implemented 1012 | 1013 | ; Controls the ODBC cursor model. 1014 | ; Default: SQL_CURSOR_STATIC (default). 1015 | ;odbc.default_cursortype 1016 | 1017 | ; Allow or prevent persistent links. 1018 | ; http://php.net/odbc.allow-persistent 1019 | odbc.allow_persistent = On 1020 | 1021 | ; Check that a connection is still valid before reuse. 1022 | ; http://php.net/odbc.check-persistent 1023 | odbc.check_persistent = On 1024 | 1025 | ; Maximum number of persistent links. -1 means no limit. 1026 | ; http://php.net/odbc.max-persistent 1027 | odbc.max_persistent = -1 1028 | 1029 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1030 | ; http://php.net/odbc.max-links 1031 | odbc.max_links = -1 1032 | 1033 | ; Handling of LONG fields. Returns number of bytes to variables. 0 means 1034 | ; passthru. 1035 | ; http://php.net/odbc.defaultlrl 1036 | odbc.defaultlrl = 4096 1037 | 1038 | ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. 1039 | ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation 1040 | ; of odbc.defaultlrl and odbc.defaultbinmode 1041 | ; http://php.net/odbc.defaultbinmode 1042 | odbc.defaultbinmode = 1 1043 | 1044 | ;birdstep.max_links = -1 1045 | 1046 | [Interbase] 1047 | ; Allow or prevent persistent links. 1048 | ibase.allow_persistent = 1 1049 | 1050 | ; Maximum number of persistent links. -1 means no limit. 1051 | ibase.max_persistent = -1 1052 | 1053 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1054 | ibase.max_links = -1 1055 | 1056 | ; Default database name for ibase_connect(). 1057 | ;ibase.default_db = 1058 | 1059 | ; Default username for ibase_connect(). 1060 | ;ibase.default_user = 1061 | 1062 | ; Default password for ibase_connect(). 1063 | ;ibase.default_password = 1064 | 1065 | ; Default charset for ibase_connect(). 1066 | ;ibase.default_charset = 1067 | 1068 | ; Default timestamp format. 1069 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S" 1070 | 1071 | ; Default date format. 1072 | ibase.dateformat = "%Y-%m-%d" 1073 | 1074 | ; Default time format. 1075 | ibase.timeformat = "%H:%M:%S" 1076 | 1077 | [MySQL] 1078 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1079 | ; http://php.net/mysql.allow_local_infile 1080 | mysql.allow_local_infile = On 1081 | 1082 | ; Allow or prevent persistent links. 1083 | ; http://php.net/mysql.allow-persistent 1084 | mysql.allow_persistent = On 1085 | 1086 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1087 | ; http://php.net/mysql.cache_size 1088 | mysql.cache_size = 2000 1089 | 1090 | ; Maximum number of persistent links. -1 means no limit. 1091 | ; http://php.net/mysql.max-persistent 1092 | mysql.max_persistent = -1 1093 | 1094 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1095 | ; http://php.net/mysql.max-links 1096 | mysql.max_links = -1 1097 | 1098 | ; Default port number for mysql_connect(). If unset, mysql_connect() will use 1099 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1100 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1101 | ; at MYSQL_PORT. 1102 | ; http://php.net/mysql.default-port 1103 | mysql.default_port = 1104 | 1105 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1106 | ; MySQL defaults. 1107 | ; http://php.net/mysql.default-socket 1108 | mysql.default_socket = 1109 | 1110 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1111 | ; http://php.net/mysql.default-host 1112 | mysql.default_host = 1113 | 1114 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1115 | ; http://php.net/mysql.default-user 1116 | mysql.default_user = 1117 | 1118 | ; Default password for mysql_connect() (doesn't apply in safe mode). 1119 | ; Note that this is generally a *bad* idea to store passwords in this file. 1120 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") 1121 | ; and reveal this password! And of course, any users with read access to this 1122 | ; file will be able to reveal the password as well. 1123 | ; http://php.net/mysql.default-password 1124 | mysql.default_password = 1125 | 1126 | ; Maximum time (in seconds) for connect timeout. -1 means no limit 1127 | ; http://php.net/mysql.connect-timeout 1128 | mysql.connect_timeout = 60 1129 | 1130 | ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and 1131 | ; SQL-Errors will be displayed. 1132 | ; http://php.net/mysql.trace-mode 1133 | mysql.trace_mode = Off 1134 | 1135 | [MySQLi] 1136 | 1137 | ; Maximum number of persistent links. -1 means no limit. 1138 | ; http://php.net/mysqli.max-persistent 1139 | mysqli.max_persistent = -1 1140 | 1141 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1142 | ; http://php.net/mysqli.allow_local_infile 1143 | ;mysqli.allow_local_infile = On 1144 | 1145 | ; Allow or prevent persistent links. 1146 | ; http://php.net/mysqli.allow-persistent 1147 | mysqli.allow_persistent = On 1148 | 1149 | ; Maximum number of links. -1 means no limit. 1150 | ; http://php.net/mysqli.max-links 1151 | mysqli.max_links = -1 1152 | 1153 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1154 | ; http://php.net/mysqli.cache_size 1155 | mysqli.cache_size = 2000 1156 | 1157 | ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use 1158 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1159 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1160 | ; at MYSQL_PORT. 1161 | ; http://php.net/mysqli.default-port 1162 | mysqli.default_port = 3306 1163 | 1164 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1165 | ; MySQL defaults. 1166 | ; http://php.net/mysqli.default-socket 1167 | mysqli.default_socket = 1168 | 1169 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1170 | ; http://php.net/mysqli.default-host 1171 | mysqli.default_host = 1172 | 1173 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1174 | ; http://php.net/mysqli.default-user 1175 | mysqli.default_user = 1176 | 1177 | ; Default password for mysqli_connect() (doesn't apply in safe mode). 1178 | ; Note that this is generally a *bad* idea to store passwords in this file. 1179 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") 1180 | ; and reveal this password! And of course, any users with read access to this 1181 | ; file will be able to reveal the password as well. 1182 | ; http://php.net/mysqli.default-pw 1183 | mysqli.default_pw = 1184 | 1185 | ; Allow or prevent reconnect 1186 | mysqli.reconnect = Off 1187 | 1188 | [mysqlnd] 1189 | ; Enable / Disable collection of general statistics by mysqlnd which can be 1190 | ; used to tune and monitor MySQL operations. 1191 | ; http://php.net/mysqlnd.collect_statistics 1192 | mysqlnd.collect_statistics = On 1193 | 1194 | ; Enable / Disable collection of memory usage statistics by mysqlnd which can be 1195 | ; used to tune and monitor MySQL operations. 1196 | ; http://php.net/mysqlnd.collect_memory_statistics 1197 | mysqlnd.collect_memory_statistics = Off 1198 | 1199 | ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. 1200 | ; http://php.net/mysqlnd.net_cmd_buffer_size 1201 | ;mysqlnd.net_cmd_buffer_size = 2048 1202 | 1203 | ; Size of a pre-allocated buffer used for reading data sent by the server in 1204 | ; bytes. 1205 | ; http://php.net/mysqlnd.net_read_buffer_size 1206 | ;mysqlnd.net_read_buffer_size = 32768 1207 | 1208 | [OCI8] 1209 | 1210 | ; Connection: Enables privileged connections using external 1211 | ; credentials (OCI_SYSOPER, OCI_SYSDBA) 1212 | ; http://php.net/oci8.privileged-connect 1213 | ;oci8.privileged_connect = Off 1214 | 1215 | ; Connection: The maximum number of persistent OCI8 connections per 1216 | ; process. Using -1 means no limit. 1217 | ; http://php.net/oci8.max-persistent 1218 | ;oci8.max_persistent = -1 1219 | 1220 | ; Connection: The maximum number of seconds a process is allowed to 1221 | ; maintain an idle persistent connection. Using -1 means idle 1222 | ; persistent connections will be maintained forever. 1223 | ; http://php.net/oci8.persistent-timeout 1224 | ;oci8.persistent_timeout = -1 1225 | 1226 | ; Connection: The number of seconds that must pass before issuing a 1227 | ; ping during oci_pconnect() to check the connection validity. When 1228 | ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables 1229 | ; pings completely. 1230 | ; http://php.net/oci8.ping-interval 1231 | ;oci8.ping_interval = 60 1232 | 1233 | ; Connection: Set this to a user chosen connection class to be used 1234 | ; for all pooled server requests with Oracle 11g Database Resident 1235 | ; Connection Pooling (DRCP). To use DRCP, this value should be set to 1236 | ; the same string for all web servers running the same application, 1237 | ; the database pool must be configured, and the connection string must 1238 | ; specify to use a pooled server. 1239 | ;oci8.connection_class = 1240 | 1241 | ; High Availability: Using On lets PHP receive Fast Application 1242 | ; Notification (FAN) events generated when a database node fails. The 1243 | ; database must also be configured to post FAN events. 1244 | ;oci8.events = Off 1245 | 1246 | ; Tuning: This option enables statement caching, and specifies how 1247 | ; many statements to cache. Using 0 disables statement caching. 1248 | ; http://php.net/oci8.statement-cache-size 1249 | ;oci8.statement_cache_size = 20 1250 | 1251 | ; Tuning: Enables statement prefetching and sets the default number of 1252 | ; rows that will be fetched automatically after statement execution. 1253 | ; http://php.net/oci8.default-prefetch 1254 | ;oci8.default_prefetch = 100 1255 | 1256 | ; Compatibility. Using On means oci_close() will not close 1257 | ; oci_connect() and oci_new_connect() connections. 1258 | ; http://php.net/oci8.old-oci-close-semantics 1259 | ;oci8.old_oci_close_semantics = Off 1260 | 1261 | [PostgreSQL] 1262 | ; Allow or prevent persistent links. 1263 | ; http://php.net/pgsql.allow-persistent 1264 | pgsql.allow_persistent = On 1265 | 1266 | ; Detect broken persistent links always with pg_pconnect(). 1267 | ; Auto reset feature requires a little overheads. 1268 | ; http://php.net/pgsql.auto-reset-persistent 1269 | pgsql.auto_reset_persistent = Off 1270 | 1271 | ; Maximum number of persistent links. -1 means no limit. 1272 | ; http://php.net/pgsql.max-persistent 1273 | pgsql.max_persistent = -1 1274 | 1275 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1276 | ; http://php.net/pgsql.max-links 1277 | pgsql.max_links = -1 1278 | 1279 | ; Ignore PostgreSQL backends Notice message or not. 1280 | ; Notice message logging require a little overheads. 1281 | ; http://php.net/pgsql.ignore-notice 1282 | pgsql.ignore_notice = 0 1283 | 1284 | ; Log PostgreSQL backends Notice message or not. 1285 | ; Unless pgsql.ignore_notice=0, module cannot log notice message. 1286 | ; http://php.net/pgsql.log-notice 1287 | pgsql.log_notice = 0 1288 | 1289 | [Sybase-CT] 1290 | ; Allow or prevent persistent links. 1291 | ; http://php.net/sybct.allow-persistent 1292 | sybct.allow_persistent = On 1293 | 1294 | ; Maximum number of persistent links. -1 means no limit. 1295 | ; http://php.net/sybct.max-persistent 1296 | sybct.max_persistent = -1 1297 | 1298 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1299 | ; http://php.net/sybct.max-links 1300 | sybct.max_links = -1 1301 | 1302 | ; Minimum server message severity to display. 1303 | ; http://php.net/sybct.min-server-severity 1304 | sybct.min_server_severity = 10 1305 | 1306 | ; Minimum client message severity to display. 1307 | ; http://php.net/sybct.min-client-severity 1308 | sybct.min_client_severity = 10 1309 | 1310 | ; Set per-context timeout 1311 | ; http://php.net/sybct.timeout 1312 | ;sybct.timeout= 1313 | 1314 | ;sybct.packet_size 1315 | 1316 | ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. 1317 | ; Default: one minute 1318 | ;sybct.login_timeout= 1319 | 1320 | ; The name of the host you claim to be connecting from, for display by sp_who. 1321 | ; Default: none 1322 | ;sybct.hostname= 1323 | 1324 | ; Allows you to define how often deadlocks are to be retried. -1 means "forever". 1325 | ; Default: 0 1326 | ;sybct.deadlock_retry_count= 1327 | 1328 | [bcmath] 1329 | ; Number of decimal digits for all bcmath functions. 1330 | ; http://php.net/bcmath.scale 1331 | bcmath.scale = 0 1332 | 1333 | [browscap] 1334 | ; http://php.net/browscap 1335 | ;browscap = extra/browscap.ini 1336 | 1337 | [Session] 1338 | ; Handler used to store/retrieve data. 1339 | ; http://php.net/session.save-handler 1340 | session.save_handler = files 1341 | 1342 | ; Argument passed to save_handler. In the case of files, this is the path 1343 | ; where data files are stored. Note: Windows users have to change this 1344 | ; variable in order to use PHP's session functions. 1345 | ; 1346 | ; The path can be defined as: 1347 | ; 1348 | ; session.save_path = "N;/path" 1349 | ; 1350 | ; where N is an integer. Instead of storing all the session files in 1351 | ; /path, what this will do is use subdirectories N-levels deep, and 1352 | ; store the session data in those directories. This is useful if 1353 | ; your OS has problems with many files in one directory, and is 1354 | ; a more efficient layout for servers that handle many sessions. 1355 | ; 1356 | ; NOTE 1: PHP will not create this directory structure automatically. 1357 | ; You can use the script in the ext/session dir for that purpose. 1358 | ; NOTE 2: See the section on garbage collection below if you choose to 1359 | ; use subdirectories for session storage 1360 | ; 1361 | ; The file storage module creates files using mode 600 by default. 1362 | ; You can change that by using 1363 | ; 1364 | ; session.save_path = "N;MODE;/path" 1365 | ; 1366 | ; where MODE is the octal representation of the mode. Note that this 1367 | ; does not overwrite the process's umask. 1368 | ; http://php.net/session.save-path 1369 | ;session.save_path = "/var/lib/php5/sessions" 1370 | 1371 | ; Whether to use strict session mode. 1372 | ; Strict session mode does not accept uninitialized session ID and regenerate 1373 | ; session ID if browser sends uninitialized session ID. Strict mode protects 1374 | ; applications from session fixation via session adoption vulnerability. It is 1375 | ; disabled by default for maximum compatibility, but enabling it is encouraged. 1376 | ; https://wiki.php.net/rfc/strict_sessions 1377 | session.use_strict_mode = 0 1378 | 1379 | ; Whether to use cookies. 1380 | ; http://php.net/session.use-cookies 1381 | session.use_cookies = 1 1382 | 1383 | ; http://php.net/session.cookie-secure 1384 | ;session.cookie_secure = 1385 | 1386 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 1387 | ; the session id. We encourage this operation as it's very helpful in combating 1388 | ; session hijacking when not specifying and managing your own session id. It is 1389 | ; not the be-all and end-all of session hijacking defense, but it's a good start. 1390 | ; http://php.net/session.use-only-cookies 1391 | session.use_only_cookies = 1 1392 | 1393 | ; Name of the session (used as cookie name). 1394 | ; http://php.net/session.name 1395 | session.name = PHPSESSID 1396 | 1397 | ; Initialize session on request startup. 1398 | ; http://php.net/session.auto-start 1399 | session.auto_start = 0 1400 | 1401 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 1402 | ; http://php.net/session.cookie-lifetime 1403 | session.cookie_lifetime = 0 1404 | 1405 | ; The path for which the cookie is valid. 1406 | ; http://php.net/session.cookie-path 1407 | session.cookie_path = / 1408 | 1409 | ; The domain for which the cookie is valid. 1410 | ; http://php.net/session.cookie-domain 1411 | session.cookie_domain = 1412 | 1413 | ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. 1414 | ; http://php.net/session.cookie-httponly 1415 | session.cookie_httponly = 1416 | 1417 | ; Handler used to serialize data. php is the standard serializer of PHP. 1418 | ; http://php.net/session.serialize-handler 1419 | session.serialize_handler = php 1420 | 1421 | ; Defines the probability that the 'garbage collection' process is started 1422 | ; on every session initialization. The probability is calculated by using 1423 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator 1424 | ; and gc_divisor is the denominator in the equation. Setting this value to 1 1425 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1426 | ; the gc will run on any give request. 1427 | ; Default Value: 1 1428 | ; Development Value: 1 1429 | ; Production Value: 1 1430 | ; http://php.net/session.gc-probability 1431 | session.gc_probability = 0 1432 | 1433 | ; Defines the probability that the 'garbage collection' process is started on every 1434 | ; session initialization. The probability is calculated by using the following equation: 1435 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and 1436 | ; session.gc_divisor is the denominator in the equation. Setting this value to 1 1437 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1438 | ; the gc will run on any give request. Increasing this value to 1000 will give you 1439 | ; a 0.1% chance the gc will run on any give request. For high volume production servers, 1440 | ; this is a more efficient approach. 1441 | ; Default Value: 100 1442 | ; Development Value: 1000 1443 | ; Production Value: 1000 1444 | ; http://php.net/session.gc-divisor 1445 | session.gc_divisor = 1000 1446 | 1447 | ; After this number of seconds, stored data will be seen as 'garbage' and 1448 | ; cleaned up by the garbage collection process. 1449 | ; http://php.net/session.gc-maxlifetime 1450 | session.gc_maxlifetime = 1440 1451 | 1452 | ; NOTE: If you are using the subdirectory option for storing session files 1453 | ; (see session.save_path above), then garbage collection does *not* 1454 | ; happen automatically. You will need to do your own garbage 1455 | ; collection through a shell script, cron entry, or some other method. 1456 | ; For example, the following script would is the equivalent of 1457 | ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 1458 | ; find /path/to/sessions -cmin +24 -type f | xargs rm 1459 | 1460 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 1461 | ; HTTP_REFERER has to contain this substring for the session to be 1462 | ; considered as valid. 1463 | ; http://php.net/session.referer-check 1464 | session.referer_check = 1465 | 1466 | ; How many bytes to read from the file. 1467 | ; http://php.net/session.entropy-length 1468 | ;session.entropy_length = 32 1469 | 1470 | ; Specified here to create the session id. 1471 | ; http://php.net/session.entropy-file 1472 | ; Defaults to /dev/urandom 1473 | ; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom 1474 | ; If neither are found at compile time, the default is no entropy file. 1475 | ; On windows, setting the entropy_length setting will activate the 1476 | ; Windows random source (using the CryptoAPI) 1477 | ;session.entropy_file = /dev/urandom 1478 | 1479 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 1480 | ; or leave this empty to avoid sending anti-caching headers. 1481 | ; http://php.net/session.cache-limiter 1482 | session.cache_limiter = nocache 1483 | 1484 | ; Document expires after n minutes. 1485 | ; http://php.net/session.cache-expire 1486 | session.cache_expire = 180 1487 | 1488 | ; trans sid support is disabled by default. 1489 | ; Use of trans sid may risk your users' security. 1490 | ; Use this option with caution. 1491 | ; - User may send URL contains active session ID 1492 | ; to other person via. email/irc/etc. 1493 | ; - URL that contains active session ID may be stored 1494 | ; in publicly accessible computer. 1495 | ; - User may access your site with the same session ID 1496 | ; always using URL stored in browser's history or bookmarks. 1497 | ; http://php.net/session.use-trans-sid 1498 | session.use_trans_sid = 0 1499 | 1500 | ; Select a hash function for use in generating session ids. 1501 | ; Possible Values 1502 | ; 0 (MD5 128 bits) 1503 | ; 1 (SHA-1 160 bits) 1504 | ; This option may also be set to the name of any hash function supported by 1505 | ; the hash extension. A list of available hashes is returned by the hash_algos() 1506 | ; function. 1507 | ; http://php.net/session.hash-function 1508 | session.hash_function = 0 1509 | 1510 | ; Define how many bits are stored in each character when converting 1511 | ; the binary hash data to something readable. 1512 | ; Possible values: 1513 | ; 4 (4 bits: 0-9, a-f) 1514 | ; 5 (5 bits: 0-9, a-v) 1515 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 1516 | ; Default Value: 4 1517 | ; Development Value: 5 1518 | ; Production Value: 5 1519 | ; http://php.net/session.hash-bits-per-character 1520 | session.hash_bits_per_character = 5 1521 | 1522 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 1523 | ; form/fieldset are special; if you include them here, the rewriter will 1524 | ; add a hidden field with the info which is otherwise appended 1525 | ; to URLs. If you want XHTML conformity, remove the form entry. 1526 | ; Note that all valid entries require a "=", even if no value follows. 1527 | ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" 1528 | ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 1529 | ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 1530 | ; http://php.net/url-rewriter.tags 1531 | url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" 1532 | 1533 | ; Enable upload progress tracking in $_SESSION 1534 | ; Default Value: On 1535 | ; Development Value: On 1536 | ; Production Value: On 1537 | ; http://php.net/session.upload-progress.enabled 1538 | ;session.upload_progress.enabled = On 1539 | 1540 | ; Cleanup the progress information as soon as all POST data has been read 1541 | ; (i.e. upload completed). 1542 | ; Default Value: On 1543 | ; Development Value: On 1544 | ; Production Value: On 1545 | ; http://php.net/session.upload-progress.cleanup 1546 | ;session.upload_progress.cleanup = On 1547 | 1548 | ; A prefix used for the upload progress key in $_SESSION 1549 | ; Default Value: "upload_progress_" 1550 | ; Development Value: "upload_progress_" 1551 | ; Production Value: "upload_progress_" 1552 | ; http://php.net/session.upload-progress.prefix 1553 | ;session.upload_progress.prefix = "upload_progress_" 1554 | 1555 | ; The index name (concatenated with the prefix) in $_SESSION 1556 | ; containing the upload progress information 1557 | ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" 1558 | ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" 1559 | ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" 1560 | ; http://php.net/session.upload-progress.name 1561 | ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" 1562 | 1563 | ; How frequently the upload progress should be updated. 1564 | ; Given either in percentages (per-file), or in bytes 1565 | ; Default Value: "1%" 1566 | ; Development Value: "1%" 1567 | ; Production Value: "1%" 1568 | ; http://php.net/session.upload-progress.freq 1569 | ;session.upload_progress.freq = "1%" 1570 | 1571 | ; The minimum delay between updates, in seconds 1572 | ; Default Value: 1 1573 | ; Development Value: 1 1574 | ; Production Value: 1 1575 | ; http://php.net/session.upload-progress.min-freq 1576 | ;session.upload_progress.min_freq = "1" 1577 | 1578 | [MSSQL] 1579 | ; Allow or prevent persistent links. 1580 | mssql.allow_persistent = On 1581 | 1582 | ; Maximum number of persistent links. -1 means no limit. 1583 | mssql.max_persistent = -1 1584 | 1585 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1586 | mssql.max_links = -1 1587 | 1588 | ; Minimum error severity to display. 1589 | mssql.min_error_severity = 10 1590 | 1591 | ; Minimum message severity to display. 1592 | mssql.min_message_severity = 10 1593 | 1594 | ; Compatibility mode with old versions of PHP 3.0. 1595 | mssql.compatibility_mode = Off 1596 | 1597 | ; Connect timeout 1598 | ;mssql.connect_timeout = 5 1599 | 1600 | ; Query timeout 1601 | ;mssql.timeout = 60 1602 | 1603 | ; Valid range 0 - 2147483647. Default = 4096. 1604 | ;mssql.textlimit = 4096 1605 | 1606 | ; Valid range 0 - 2147483647. Default = 4096. 1607 | ;mssql.textsize = 4096 1608 | 1609 | ; Limits the number of records in each batch. 0 = all records in one batch. 1610 | ;mssql.batchsize = 0 1611 | 1612 | ; Specify how datetime and datetim4 columns are returned 1613 | ; On => Returns data converted to SQL server settings 1614 | ; Off => Returns values as YYYY-MM-DD hh:mm:ss 1615 | ;mssql.datetimeconvert = On 1616 | 1617 | ; Use NT authentication when connecting to the server 1618 | mssql.secure_connection = Off 1619 | 1620 | ; Specify max number of processes. -1 = library default 1621 | ; msdlib defaults to 25 1622 | ; FreeTDS defaults to 4096 1623 | ;mssql.max_procs = -1 1624 | 1625 | ; Specify client character set. 1626 | ; If empty or not set the client charset from freetds.conf is used 1627 | ; This is only used when compiled with FreeTDS 1628 | ;mssql.charset = "ISO-8859-1" 1629 | 1630 | [Assertion] 1631 | ; Assert(expr); active by default. 1632 | ; http://php.net/assert.active 1633 | ;assert.active = On 1634 | 1635 | ; Issue a PHP warning for each failed assertion. 1636 | ; http://php.net/assert.warning 1637 | ;assert.warning = On 1638 | 1639 | ; Don't bail out by default. 1640 | ; http://php.net/assert.bail 1641 | ;assert.bail = Off 1642 | 1643 | ; User-function to be called if an assertion fails. 1644 | ; http://php.net/assert.callback 1645 | ;assert.callback = 0 1646 | 1647 | ; Eval the expression with current error_reporting(). Set to true if you want 1648 | ; error_reporting(0) around the eval(). 1649 | ; http://php.net/assert.quiet-eval 1650 | ;assert.quiet_eval = 0 1651 | 1652 | [COM] 1653 | ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs 1654 | ; http://php.net/com.typelib-file 1655 | ;com.typelib_file = 1656 | 1657 | ; allow Distributed-COM calls 1658 | ; http://php.net/com.allow-dcom 1659 | ;com.allow_dcom = true 1660 | 1661 | ; autoregister constants of a components typlib on com_load() 1662 | ; http://php.net/com.autoregister-typelib 1663 | ;com.autoregister_typelib = true 1664 | 1665 | ; register constants casesensitive 1666 | ; http://php.net/com.autoregister-casesensitive 1667 | ;com.autoregister_casesensitive = false 1668 | 1669 | ; show warnings on duplicate constant registrations 1670 | ; http://php.net/com.autoregister-verbose 1671 | ;com.autoregister_verbose = true 1672 | 1673 | ; The default character set code-page to use when passing strings to and from COM objects. 1674 | ; Default: system ANSI code page 1675 | ;com.code_page= 1676 | 1677 | [mbstring] 1678 | ; language for internal character representation. 1679 | ; This affects mb_send_mail() and mbstrig.detect_order. 1680 | ; http://php.net/mbstring.language 1681 | ;mbstring.language = Japanese 1682 | 1683 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 1684 | ; internal/script encoding. 1685 | ; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) 1686 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 1687 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 1688 | ;mbstring.internal_encoding = 1689 | 1690 | ; Use of this INI entry is deprecated, use global input_encoding instead. 1691 | ; http input encoding. 1692 | ; mbstring.encoding_traslation = On is needed to use this setting. 1693 | ; If empty, default_charset or input_encoding or mbstring.input is used. 1694 | ; The precedence is: default_charset < intput_encoding < mbsting.http_input 1695 | ; http://php.net/mbstring.http-input 1696 | ;mbstring.http_input = 1697 | 1698 | ; Use of this INI entry is deprecated, use global output_encoding instead. 1699 | ; http output encoding. 1700 | ; mb_output_handler must be registered as output buffer to function. 1701 | ; If empty, default_charset or output_encoding or mbstring.http_output is used. 1702 | ; The precedence is: default_charset < output_encoding < mbstring.http_output 1703 | ; To use an output encoding conversion, mbstring's output handler must be set 1704 | ; otherwise output encoding conversion cannot be performed. 1705 | ; http://php.net/mbstring.http-output 1706 | ;mbstring.http_output = 1707 | 1708 | ; enable automatic encoding translation according to 1709 | ; mbstring.internal_encoding setting. Input chars are 1710 | ; converted to internal encoding by setting this to On. 1711 | ; Note: Do _not_ use automatic encoding translation for 1712 | ; portable libs/applications. 1713 | ; http://php.net/mbstring.encoding-translation 1714 | ;mbstring.encoding_translation = Off 1715 | 1716 | ; automatic encoding detection order. 1717 | ; "auto" detect order is changed according to mbstring.language 1718 | ; http://php.net/mbstring.detect-order 1719 | ;mbstring.detect_order = auto 1720 | 1721 | ; substitute_character used when character cannot be converted 1722 | ; one from another 1723 | ; http://php.net/mbstring.substitute-character 1724 | ;mbstring.substitute_character = none 1725 | 1726 | ; overload(replace) single byte functions by mbstring functions. 1727 | ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), 1728 | ; etc. Possible values are 0,1,2,4 or combination of them. 1729 | ; For example, 7 for overload everything. 1730 | ; 0: No overload 1731 | ; 1: Overload mail() function 1732 | ; 2: Overload str*() functions 1733 | ; 4: Overload ereg*() functions 1734 | ; http://php.net/mbstring.func-overload 1735 | ;mbstring.func_overload = 0 1736 | 1737 | ; enable strict encoding detection. 1738 | ; Default: Off 1739 | ;mbstring.strict_detection = On 1740 | 1741 | ; This directive specifies the regex pattern of content types for which mb_output_handler() 1742 | ; is activated. 1743 | ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) 1744 | ;mbstring.http_output_conv_mimetype= 1745 | 1746 | [gd] 1747 | ; Tell the jpeg decode to ignore warnings and try to create 1748 | ; a gd image. The warning will then be displayed as notices 1749 | ; disabled by default 1750 | ; http://php.net/gd.jpeg-ignore-warning 1751 | ;gd.jpeg_ignore_warning = 0 1752 | 1753 | [exif] 1754 | ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. 1755 | ; With mbstring support this will automatically be converted into the encoding 1756 | ; given by corresponding encode setting. When empty mbstring.internal_encoding 1757 | ; is used. For the decode settings you can distinguish between motorola and 1758 | ; intel byte order. A decode setting cannot be empty. 1759 | ; http://php.net/exif.encode-unicode 1760 | ;exif.encode_unicode = ISO-8859-15 1761 | 1762 | ; http://php.net/exif.decode-unicode-motorola 1763 | ;exif.decode_unicode_motorola = UCS-2BE 1764 | 1765 | ; http://php.net/exif.decode-unicode-intel 1766 | ;exif.decode_unicode_intel = UCS-2LE 1767 | 1768 | ; http://php.net/exif.encode-jis 1769 | ;exif.encode_jis = 1770 | 1771 | ; http://php.net/exif.decode-jis-motorola 1772 | ;exif.decode_jis_motorola = JIS 1773 | 1774 | ; http://php.net/exif.decode-jis-intel 1775 | ;exif.decode_jis_intel = JIS 1776 | 1777 | [Tidy] 1778 | ; The path to a default tidy configuration file to use when using tidy 1779 | ; http://php.net/tidy.default-config 1780 | ;tidy.default_config = /usr/local/lib/php/default.tcfg 1781 | 1782 | ; Should tidy clean and repair output automatically? 1783 | ; WARNING: Do not use this option if you are generating non-html content 1784 | ; such as dynamic images 1785 | ; http://php.net/tidy.clean-output 1786 | tidy.clean_output = Off 1787 | 1788 | [soap] 1789 | ; Enables or disables WSDL caching feature. 1790 | ; http://php.net/soap.wsdl-cache-enabled 1791 | soap.wsdl_cache_enabled=1 1792 | 1793 | ; Sets the directory name where SOAP extension will put cache files. 1794 | ; http://php.net/soap.wsdl-cache-dir 1795 | soap.wsdl_cache_dir="/tmp" 1796 | 1797 | ; (time to live) Sets the number of second while cached file will be used 1798 | ; instead of original one. 1799 | ; http://php.net/soap.wsdl-cache-ttl 1800 | soap.wsdl_cache_ttl=86400 1801 | 1802 | ; Sets the size of the cache limit. (Max. number of WSDL files to cache) 1803 | soap.wsdl_cache_limit = 5 1804 | 1805 | [sysvshm] 1806 | ; A default size of the shared memory segment 1807 | ;sysvshm.init_mem = 10000 1808 | 1809 | [ldap] 1810 | ; Sets the maximum number of open links or -1 for unlimited. 1811 | ldap.max_links = -1 1812 | 1813 | [mcrypt] 1814 | ; For more information about mcrypt settings see http://php.net/mcrypt-module-open 1815 | 1816 | ; Directory where to load mcrypt algorithms 1817 | ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) 1818 | ;mcrypt.algorithms_dir= 1819 | 1820 | ; Directory where to load mcrypt modes 1821 | ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) 1822 | ;mcrypt.modes_dir= 1823 | 1824 | [dba] 1825 | ;dba.default_handler= 1826 | 1827 | [opcache] 1828 | ; Determines if Zend OPCache is enabled 1829 | ;opcache.enable=0 1830 | 1831 | ; Determines if Zend OPCache is enabled for the CLI version of PHP 1832 | ;opcache.enable_cli=0 1833 | 1834 | ; The OPcache shared memory storage size. 1835 | ;opcache.memory_consumption=64 1836 | 1837 | ; The amount of memory for interned strings in Mbytes. 1838 | ;opcache.interned_strings_buffer=4 1839 | 1840 | ; The maximum number of keys (scripts) in the OPcache hash table. 1841 | ; Only numbers between 200 and 100000 are allowed. 1842 | ;opcache.max_accelerated_files=2000 1843 | 1844 | ; The maximum percentage of "wasted" memory until a restart is scheduled. 1845 | ;opcache.max_wasted_percentage=5 1846 | 1847 | ; When this directive is enabled, the OPcache appends the current working 1848 | ; directory to the script key, thus eliminating possible collisions between 1849 | ; files with the same name (basename). Disabling the directive improves 1850 | ; performance, but may break existing applications. 1851 | ;opcache.use_cwd=1 1852 | 1853 | ; When disabled, you must reset the OPcache manually or restart the 1854 | ; webserver for changes to the filesystem to take effect. 1855 | ;opcache.validate_timestamps=1 1856 | 1857 | ; How often (in seconds) to check file timestamps for changes to the shared 1858 | ; memory storage allocation. ("1" means validate once per second, but only 1859 | ; once per request. "0" means always validate) 1860 | ;opcache.revalidate_freq=2 1861 | 1862 | ; Enables or disables file search in include_path optimization 1863 | ;opcache.revalidate_path=0 1864 | 1865 | ; If disabled, all PHPDoc comments are dropped from the code to reduce the 1866 | ; size of the optimized code. 1867 | ;opcache.save_comments=1 1868 | 1869 | ; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments" 1870 | ; may be always stored (save_comments=1), but not loaded by applications 1871 | ; that don't need them anyway. 1872 | ;opcache.load_comments=1 1873 | 1874 | ; If enabled, a fast shutdown sequence is used for the accelerated code 1875 | ;opcache.fast_shutdown=0 1876 | 1877 | ; Allow file existence override (file_exists, etc.) performance feature. 1878 | ;opcache.enable_file_override=0 1879 | 1880 | ; A bitmask, where each bit enables or disables the appropriate OPcache 1881 | ; passes 1882 | ;opcache.optimization_level=0xffffffff 1883 | 1884 | ;opcache.inherited_hack=1 1885 | ;opcache.dups_fix=0 1886 | 1887 | ; The location of the OPcache blacklist file (wildcards allowed). 1888 | ; Each OPcache blacklist file is a text file that holds the names of files 1889 | ; that should not be accelerated. The file format is to add each filename 1890 | ; to a new line. The filename may be a full path or just a file prefix 1891 | ; (i.e., /var/www/x blacklists all the files and directories in /var/www 1892 | ; that start with 'x'). Line starting with a ; are ignored (comments). 1893 | ;opcache.blacklist_filename= 1894 | 1895 | ; Allows exclusion of large files from being cached. By default all files 1896 | ; are cached. 1897 | ;opcache.max_file_size=0 1898 | 1899 | ; Check the cache checksum each N requests. 1900 | ; The default value of "0" means that the checks are disabled. 1901 | ;opcache.consistency_checks=0 1902 | 1903 | ; How long to wait (in seconds) for a scheduled restart to begin if the cache 1904 | ; is not being accessed. 1905 | ;opcache.force_restart_timeout=180 1906 | 1907 | ; OPcache error_log file name. Empty string assumes "stderr". 1908 | ;opcache.error_log= 1909 | 1910 | ; All OPcache errors go to the Web server log. 1911 | ; By default, only fatal errors (level 0) or errors (level 1) are logged. 1912 | ; You can also enable warnings (level 2), info messages (level 3) or 1913 | ; debug messages (level 4). 1914 | ;opcache.log_verbosity_level=1 1915 | 1916 | ; Preferred Shared Memory back-end. Leave empty and let the system decide. 1917 | ;opcache.preferred_memory_model= 1918 | 1919 | ; Protect the shared memory from unexpected writing during script execution. 1920 | ; Useful for internal debugging only. 1921 | ;opcache.protect_memory=0 1922 | 1923 | [curl] 1924 | ; A default value for the CURLOPT_CAINFO option. This is required to be an 1925 | ; absolute path. 1926 | ;curl.cainfo = 1927 | 1928 | [openssl] 1929 | ; The location of a Certificate Authority (CA) file on the local filesystem 1930 | ; to use when verifying the identity of SSL/TLS peers. Most users should 1931 | ; not specify a value for this directive as PHP will attempt to use the 1932 | ; OS-managed cert stores in its absence. If specified, this value may still 1933 | ; be overridden on a per-stream basis via the "cafile" SSL stream context 1934 | ; option. 1935 | ;openssl.cafile= 1936 | 1937 | ; If openssl.cafile is not specified or if the CA file is not found, the 1938 | ; directory pointed to by openssl.capath is searched for a suitable 1939 | ; certificate. This value must be a correctly hashed certificate directory. 1940 | ; Most users should not specify a value for this directive as PHP will 1941 | ; attempt to use the OS-managed cert stores in its absence. If specified, 1942 | ; this value may still be overridden on a per-stream basis via the "capath" 1943 | ; SSL stream context option. 1944 | ;openssl.capath= 1945 | 1946 | ; Local Variables: 1947 | ; tab-width: 4 1948 | ; End: 1949 | -------------------------------------------------------------------------------- /docker/php7/fpm/pool.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can we used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or /usr) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | listen.owner = www-data 48 | listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Choose how the process manager will control the number of child processes. 73 | ; Possible Values: 74 | ; static - a fixed number (pm.max_children) of child processes; 75 | ; dynamic - the number of child processes are set dynamically based on the 76 | ; following directives. With this process management, there will be 77 | ; always at least 1 children. 78 | ; pm.max_children - the maximum number of children that can 79 | ; be alive at the same time. 80 | ; pm.start_servers - the number of children created on startup. 81 | ; pm.min_spare_servers - the minimum number of children in 'idle' 82 | ; state (waiting to process). If the number 83 | ; of 'idle' processes is less than this 84 | ; number then some children will be created. 85 | ; pm.max_spare_servers - the maximum number of children in 'idle' 86 | ; state (waiting to process). If the number 87 | ; of 'idle' processes is greater than this 88 | ; number then some children will be killed. 89 | ; ondemand - no children are created at startup. Children will be forked when 90 | ; new requests will connect. The following parameter are used: 91 | ; pm.max_children - the maximum number of children that 92 | ; can be alive at the same time. 93 | ; pm.process_idle_timeout - The number of seconds after which 94 | ; an idle process will be killed. 95 | ; Note: This value is mandatory. 96 | pm = dynamic 97 | 98 | ; The number of child processes to be created when pm is set to 'static' and the 99 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 100 | ; This value sets the limit on the number of simultaneous requests that will be 101 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 102 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 103 | ; CGI. The below defaults are based on a server without much resources. Don't 104 | ; forget to tweak pm.* to fit your needs. 105 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 106 | ; Note: This value is mandatory. 107 | pm.max_children = 5 108 | 109 | ; The number of child processes created on startup. 110 | ; Note: Used only when pm is set to 'dynamic' 111 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 112 | pm.start_servers = 2 113 | 114 | ; The desired minimum number of idle server processes. 115 | ; Note: Used only when pm is set to 'dynamic' 116 | ; Note: Mandatory when pm is set to 'dynamic' 117 | pm.min_spare_servers = 1 118 | 119 | ; The desired maximum number of idle server processes. 120 | ; Note: Used only when pm is set to 'dynamic' 121 | ; Note: Mandatory when pm is set to 'dynamic' 122 | pm.max_spare_servers = 3 123 | 124 | ; The number of seconds after which an idle process will be killed. 125 | ; Note: Used only when pm is set to 'ondemand' 126 | ; Default Value: 10s 127 | ;pm.process_idle_timeout = 10s; 128 | 129 | ; The number of requests each child process should execute before respawning. 130 | ; This can be useful to work around memory leaks in 3rd party libraries. For 131 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 132 | ; Default Value: 0 133 | ;pm.max_requests = 500 134 | 135 | ; The URI to view the FPM status page. If this value is not set, no URI will be 136 | ; recognized as a status page. It shows the following informations: 137 | ; pool - the name of the pool; 138 | ; process manager - static, dynamic or ondemand; 139 | ; start time - the date and time FPM has started; 140 | ; start since - number of seconds since FPM has started; 141 | ; accepted conn - the number of request accepted by the pool; 142 | ; listen queue - the number of request in the queue of pending 143 | ; connections (see backlog in listen(2)); 144 | ; max listen queue - the maximum number of requests in the queue 145 | ; of pending connections since FPM has started; 146 | ; listen queue len - the size of the socket queue of pending connections; 147 | ; idle processes - the number of idle processes; 148 | ; active processes - the number of active processes; 149 | ; total processes - the number of idle + active processes; 150 | ; max active processes - the maximum number of active processes since FPM 151 | ; has started; 152 | ; max children reached - number of times, the process limit has been reached, 153 | ; when pm tries to start more children (works only for 154 | ; pm 'dynamic' and 'ondemand'); 155 | ; Value are updated in real time. 156 | ; Example output: 157 | ; pool: www 158 | ; process manager: static 159 | ; start time: 01/Jul/2011:17:53:49 +0200 160 | ; start since: 62636 161 | ; accepted conn: 190460 162 | ; listen queue: 0 163 | ; max listen queue: 1 164 | ; listen queue len: 42 165 | ; idle processes: 4 166 | ; active processes: 11 167 | ; total processes: 15 168 | ; max active processes: 12 169 | ; max children reached: 0 170 | ; 171 | ; By default the status page output is formatted as text/plain. Passing either 172 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 173 | ; output syntax. Example: 174 | ; http://www.foo.bar/status 175 | ; http://www.foo.bar/status?json 176 | ; http://www.foo.bar/status?html 177 | ; http://www.foo.bar/status?xml 178 | ; 179 | ; By default the status page only outputs short status. Passing 'full' in the 180 | ; query string will also return status for each pool process. 181 | ; Example: 182 | ; http://www.foo.bar/status?full 183 | ; http://www.foo.bar/status?json&full 184 | ; http://www.foo.bar/status?html&full 185 | ; http://www.foo.bar/status?xml&full 186 | ; The Full status returns for each process: 187 | ; pid - the PID of the process; 188 | ; state - the state of the process (Idle, Running, ...); 189 | ; start time - the date and time the process has started; 190 | ; start since - the number of seconds since the process has started; 191 | ; requests - the number of requests the process has served; 192 | ; request duration - the duration in s of the requests; 193 | ; request method - the request method (GET, POST, ...); 194 | ; request URI - the request URI with the query string; 195 | ; content length - the content length of the request (only with POST); 196 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 197 | ; script - the main script called (or '-' if not set); 198 | ; last request cpu - the %cpu the last request consumed 199 | ; it's always 0 if the process is not in Idle state 200 | ; because CPU calculation is done when the request 201 | ; processing has terminated; 202 | ; last request memory - the max amount of memory the last request consumed 203 | ; it's always 0 if the process is not in Idle state 204 | ; because memory calculation is done when the request 205 | ; processing has terminated; 206 | ; If the process is in Idle state, then informations are related to the 207 | ; last request the process has served. Otherwise informations are related to 208 | ; the current request being served. 209 | ; Example output: 210 | ; ************************ 211 | ; pid: 31330 212 | ; state: Running 213 | ; start time: 01/Jul/2011:17:53:49 +0200 214 | ; start since: 63087 215 | ; requests: 12808 216 | ; request duration: 1250261 217 | ; request method: GET 218 | ; request URI: /test_mem.php?N=10000 219 | ; content length: 0 220 | ; user: - 221 | ; script: /home/fat/web/docs/php/test_mem.php 222 | ; last request cpu: 0.00 223 | ; last request memory: 0 224 | ; 225 | ; Note: There is a real-time FPM status monitoring sample web page available 226 | ; It's available in: /usr/share/php/7.0/fpm/status.html 227 | ; 228 | ; Note: The value must start with a leading slash (/). The value can be 229 | ; anything, but it may not be a good idea to use the .php extension or it 230 | ; may conflict with a real PHP file. 231 | ; Default Value: not set 232 | ;pm.status_path = /status 233 | 234 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 235 | ; URI will be recognized as a ping page. This could be used to test from outside 236 | ; that FPM is alive and responding, or to 237 | ; - create a graph of FPM availability (rrd or such); 238 | ; - remove a server from a group if it is not responding (load balancing); 239 | ; - trigger alerts for the operating team (24/7). 240 | ; Note: The value must start with a leading slash (/). The value can be 241 | ; anything, but it may not be a good idea to use the .php extension or it 242 | ; may conflict with a real PHP file. 243 | ; Default Value: not set 244 | ;ping.path = /ping 245 | 246 | ; This directive may be used to customize the response of a ping request. The 247 | ; response is formatted as text/plain with a 200 response code. 248 | ; Default Value: pong 249 | ;ping.response = pong 250 | 251 | ; The access log file 252 | ; Default: not set 253 | ;access.log = log/$pool.access.log 254 | 255 | ; The access log format. 256 | ; The following syntax is allowed 257 | ; %%: the '%' character 258 | ; %C: %CPU used by the request 259 | ; it can accept the following format: 260 | ; - %{user}C for user CPU only 261 | ; - %{system}C for system CPU only 262 | ; - %{total}C for user + system CPU (default) 263 | ; %d: time taken to serve the request 264 | ; it can accept the following format: 265 | ; - %{seconds}d (default) 266 | ; - %{miliseconds}d 267 | ; - %{mili}d 268 | ; - %{microseconds}d 269 | ; - %{micro}d 270 | ; %e: an environment variable (same as $_ENV or $_SERVER) 271 | ; it must be associated with embraces to specify the name of the env 272 | ; variable. Some exemples: 273 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 274 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 275 | ; %f: script filename 276 | ; %l: content-length of the request (for POST request only) 277 | ; %m: request method 278 | ; %M: peak of memory allocated by PHP 279 | ; it can accept the following format: 280 | ; - %{bytes}M (default) 281 | ; - %{kilobytes}M 282 | ; - %{kilo}M 283 | ; - %{megabytes}M 284 | ; - %{mega}M 285 | ; %n: pool name 286 | ; %o: output header 287 | ; it must be associated with embraces to specify the name of the header: 288 | ; - %{Content-Type}o 289 | ; - %{X-Powered-By}o 290 | ; - %{Transfert-Encoding}o 291 | ; - .... 292 | ; %p: PID of the child that serviced the request 293 | ; %P: PID of the parent of the child that serviced the request 294 | ; %q: the query string 295 | ; %Q: the '?' character if query string exists 296 | ; %r: the request URI (without the query string, see %q and %Q) 297 | ; %R: remote IP address 298 | ; %s: status (response code) 299 | ; %t: server time the request was received 300 | ; it can accept a strftime(3) format: 301 | ; %d/%b/%Y:%H:%M:%S %z (default) 302 | ; The strftime(3) format must be encapsuled in a %{}t tag 303 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 304 | ; %T: time the log has been written (the request has finished) 305 | ; it can accept a strftime(3) format: 306 | ; %d/%b/%Y:%H:%M:%S %z (default) 307 | ; The strftime(3) format must be encapsuled in a %{}t tag 308 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 309 | ; %u: remote user 310 | ; 311 | ; Default: "%R - %u %t \"%m %r\" %s" 312 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 313 | 314 | ; The log file for slow requests 315 | ; Default Value: not set 316 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 317 | ;slowlog = log/$pool.log.slow 318 | 319 | ; The timeout for serving a single request after which a PHP backtrace will be 320 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 321 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 322 | ; Default Value: 0 323 | ;request_slowlog_timeout = 0 324 | 325 | ; The timeout for serving a single request after which the worker process will 326 | ; be killed. This option should be used when the 'max_execution_time' ini option 327 | ; does not stop script execution for some reason. A value of '0' means 'off'. 328 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 329 | ; Default Value: 0 330 | ;request_terminate_timeout = 0 331 | 332 | ; Set open file descriptor rlimit. 333 | ; Default Value: system defined value 334 | ;rlimit_files = 1024 335 | 336 | ; Set max core size rlimit. 337 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 338 | ; Default Value: system defined value 339 | ;rlimit_core = 0 340 | 341 | ; Chroot to this directory at the start. This value must be defined as an 342 | ; absolute path. When this value is not set, chroot is not used. 343 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 344 | ; of its subdirectories. If the pool prefix is not set, the global prefix 345 | ; will be used instead. 346 | ; Note: chrooting is a great security feature and should be used whenever 347 | ; possible. However, all PHP paths will be relative to the chroot 348 | ; (error_log, sessions.save_path, ...). 349 | ; Default Value: not set 350 | ;chroot = 351 | 352 | ; Chdir to this directory at the start. 353 | ; Note: relative path can be used. 354 | ; Default Value: current directory or / when chroot 355 | ;chdir = /var/www 356 | 357 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 358 | ; stderr will be redirected to /dev/null according to FastCGI specs. 359 | ; Note: on highloaded environement, this can cause some delay in the page 360 | ; process time (several ms). 361 | ; Default Value: no 362 | ;catch_workers_output = yes 363 | 364 | ; Clear environment in FPM workers 365 | ; Prevents arbitrary environment variables from reaching FPM worker processes 366 | ; by clearing the environment in workers before env vars specified in this 367 | ; pool configuration are added. 368 | ; Setting to "no" will make all environment variables available to PHP code 369 | ; via getenv(), $_ENV and $_SERVER. 370 | ; Default Value: yes 371 | ;clear_env = no 372 | 373 | ; Limits the extensions of the main script FPM will allow to parse. This can 374 | ; prevent configuration mistakes on the web server side. You should only limit 375 | ; FPM to .php extensions to prevent malicious users to use other extensions to 376 | ; exectute php code. 377 | ; Note: set an empty value to allow all extensions. 378 | ; Default Value: .php 379 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 380 | 381 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 382 | ; the current environment. 383 | ; Default Value: clean env 384 | ;env[HOSTNAME] = $HOSTNAME 385 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 386 | ;env[TMP] = /tmp 387 | ;env[TMPDIR] = /tmp 388 | ;env[TEMP] = /tmp 389 | 390 | ; Additional php.ini defines, specific to this pool of workers. These settings 391 | ; overwrite the values previously defined in the php.ini. The directives are the 392 | ; same as the PHP SAPI: 393 | ; php_value/php_flag - you can set classic ini defines which can 394 | ; be overwritten from PHP call 'ini_set'. 395 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 396 | ; PHP call 'ini_set' 397 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 398 | 399 | ; Defining 'extension' will load the corresponding shared extension from 400 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 401 | ; overwrite previously defined php.ini values, but will append the new value 402 | ; instead. 403 | 404 | ; Note: path INI options can be relative and will be expanded with the prefix 405 | ; (pool, global or /usr) 406 | 407 | ; Default Value: nothing is defined by default except the values in php.ini and 408 | ; specified at startup with the -d argument 409 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 410 | ;php_flag[display_errors] = off 411 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 412 | ;php_admin_flag[log_errors] = on 413 | ;php_admin_value[memory_limit] = 32M -------------------------------------------------------------------------------- /docker/php7/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /var 16 | ; Default Value: none 17 | pid = /run/php/php7.0-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; in a local file. 22 | ; Note: the default prefix is /var 23 | ; Default Value: log/php-fpm.log 24 | error_log = /var/log/php7.0-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 45 | ; interval set by emergency_restart_interval then FPM will restart. A value 46 | ; of '0' means 'Off'. 47 | ; Default Value: 0 48 | ;emergency_restart_threshold = 0 49 | 50 | ; Interval of time used by emergency_restart_interval to determine when 51 | ; a graceful restart will be initiated. This can be useful to work around 52 | ; accidental corruptions in an accelerator's shared memory. 53 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 54 | ; Default Unit: seconds 55 | ; Default Value: 0 56 | ;emergency_restart_interval = 0 57 | 58 | ; Time limit for child processes to wait for a reaction on signals from master. 59 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 60 | ; Default Unit: seconds 61 | ; Default Value: 0 62 | ;process_control_timeout = 0 63 | 64 | ; The maximum number of processes FPM will fork. This has been design to control 65 | ; the global number of processes when using dynamic PM within a lot of pools. 66 | ; Use it with caution. 67 | ; Note: A value of 0 indicates no limit 68 | ; Default Value: 0 69 | ; process.max = 128 70 | 71 | ; Specify the nice(2) priority to apply to the master process (only if set) 72 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 73 | ; Note: - It will only work if the FPM master process is launched as root 74 | ; - The pool process will inherit the master process priority 75 | ; unless it specified otherwise 76 | ; Default Value: no set 77 | ; process.priority = -19 78 | 79 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 80 | ; Default Value: yes 81 | ;daemonize = yes 82 | 83 | ; Set open file descriptor rlimit for the master process. 84 | ; Default Value: system defined value 85 | ;rlimit_files = 1024 86 | 87 | ; Set max core size rlimit for the master process. 88 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 89 | ; Default Value: system defined value 90 | ;rlimit_core = 0 91 | 92 | ; Specify the event mechanism FPM will use. The following is available: 93 | ; - select (any POSIX os) 94 | ; - poll (any POSIX os) 95 | ; - epoll (linux >= 2.5.44) 96 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 97 | ; - /dev/poll (Solaris >= 7) 98 | ; - port (Solaris >= 10) 99 | ; Default Value: not set (auto detection) 100 | ;events.mechanism = epoll 101 | 102 | ; When FPM is build with systemd integration, specify the interval, 103 | ; in second, between health report notification to systemd. 104 | ; Set to 0 to disable. 105 | ; Available Units: s(econds), m(inutes), h(ours) 106 | ; Default Unit: seconds 107 | ; Default value: 10 108 | ;systemd_interval = 10 109 | 110 | ;;;;;;;;;;;;;;;;;;;; 111 | ; Pool Definitions ; 112 | ;;;;;;;;;;;;;;;;;;;; 113 | 114 | ; Multiple pools of child processes may be started with different listening 115 | ; ports and different management options. The name of the pool will be 116 | ; used in logs and stats. There is no limitation on the number of pools which 117 | ; FPM can handle. Your system will tell you anyway :) 118 | 119 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 120 | ; files from a glob(3) pattern. This directive can be used everywhere in the 121 | ; file. 122 | ; Relative path can also be used. They will be prefixed by: 123 | ; - the global prefix if it's been set (-p argument) 124 | ; - /usr otherwise 125 | include=/etc/php/7.0/fpm/pool.d/*.conf 126 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 |

Mod-Rewrite is not enabled

Please enable rewrite module on your web server to continue -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gte451f/phalcon-json-api/72bbae0e51cde7b2a746bf1df6dbdbcb8dc027c5/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handle(); 42 | } catch (Phalcon\Exception $e) { 43 | if ($config['application']['debugApp'] == true) { 44 | http_response_code(500); 45 | echo 'Framework exception caught: ' . $e->getMessage(), PHP_EOL; 46 | echo $e->getTraceAsString(), PHP_EOL; 47 | } else { 48 | throw new HTTPException('Framework Exception Caught.', 500, [ 49 | 'dev' => $e->getMessage(), 50 | 'code' => '49846461681613616813.3131' 51 | ]); 52 | } 53 | } catch (PDOException $e) { 54 | // seems like this is only run when an unexpected database exception occurs 55 | if ($config['application']['debugApp'] == true) { 56 | http_response_code(500); 57 | echo 'Database exception caught: ' . $e->getMessage(), PHP_EOL; 58 | echo $e->getTraceAsString(), PHP_EOL; 59 | } else { 60 | throw new DatabaseException('Database Exception Caught.', 500, [ 61 | 'dev' => $e->getMessage(), 62 | 'code' => '546846131616106860' 63 | ]); 64 | } 65 | } -------------------------------------------------------------------------------- /public/test.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/_bootstrap.php: -------------------------------------------------------------------------------- 1 | getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); 31 | } 32 | 33 | 34 | /** 35 | * [!] Method is generated. Documentation taken from corresponding module. 36 | * 37 | * Checks that two variables are not equal 38 | * 39 | * @param $expected 40 | * @param $actual 41 | * @param string $message 42 | * @see \Codeception\Module\Asserts::assertNotEquals() 43 | */ 44 | public function assertNotEquals($expected, $actual, $message = null) { 45 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); 46 | } 47 | 48 | 49 | /** 50 | * [!] Method is generated. Documentation taken from corresponding module. 51 | * 52 | * Checks that two variables are same 53 | * 54 | * @param $expected 55 | * @param $actual 56 | * @param string $message 57 | * @return mixed|void 58 | * @see \Codeception\Module\Asserts::assertSame() 59 | */ 60 | public function assertSame($expected, $actual, $message = null) { 61 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args())); 62 | } 63 | 64 | 65 | /** 66 | * [!] Method is generated. Documentation taken from corresponding module. 67 | * 68 | * Checks that two variables are not same 69 | * 70 | * @param $expected 71 | * @param $actual 72 | * @param string $message 73 | * @see \Codeception\Module\Asserts::assertNotSame() 74 | */ 75 | public function assertNotSame($expected, $actual, $message = null) { 76 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args())); 77 | } 78 | 79 | 80 | /** 81 | * [!] Method is generated. Documentation taken from corresponding module. 82 | * 83 | * Checks that actual is greater than expected 84 | * 85 | * @param $expected 86 | * @param $actual 87 | * @param string $message 88 | * @see \Codeception\Module\Asserts::assertGreaterThan() 89 | */ 90 | public function assertGreaterThan($expected, $actual, $message = null) { 91 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); 92 | } 93 | 94 | 95 | /** 96 | * [!] Method is generated. Documentation taken from corresponding module. 97 | * 98 | * Checks that actual is greater or equal than expected 99 | * 100 | * @param $expected 101 | * @param $actual 102 | * @param string $message 103 | * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() 104 | */ 105 | public function assertGreaterThanOrEqual($expected, $actual, $message = null) { 106 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); 107 | } 108 | 109 | 110 | /** 111 | * [!] Method is generated. Documentation taken from corresponding module. 112 | * 113 | * Checks that actual is less than expected 114 | * 115 | * @param $expected 116 | * @param $actual 117 | * @param string $message 118 | * @see \Codeception\Module\Asserts::assertLessThan() 119 | */ 120 | public function assertLessThan($expected, $actual, $message = null) { 121 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); 122 | } 123 | 124 | 125 | /** 126 | * [!] Method is generated. Documentation taken from corresponding module. 127 | * 128 | * Checks that actual is less or equal than expected 129 | * 130 | * @param $expected 131 | * @param $actual 132 | * @param string $message 133 | * @see \Codeception\Module\Asserts::assertLessThanOrEqual() 134 | */ 135 | public function assertLessThanOrEqual($expected, $actual, $message = null) { 136 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); 137 | } 138 | 139 | 140 | /** 141 | * [!] Method is generated. Documentation taken from corresponding module. 142 | * 143 | * Checks that haystack contains needle 144 | * 145 | * @param $needle 146 | * @param $haystack 147 | * @param string $message 148 | * @see \Codeception\Module\Asserts::assertContains() 149 | */ 150 | public function assertContains($needle, $haystack, $message = null) { 151 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); 152 | } 153 | 154 | 155 | /** 156 | * [!] Method is generated. Documentation taken from corresponding module. 157 | * 158 | * Checks that haystack doesn't contain needle. 159 | * 160 | * @param $needle 161 | * @param $haystack 162 | * @param string $message 163 | * @see \Codeception\Module\Asserts::assertNotContains() 164 | */ 165 | public function assertNotContains($needle, $haystack, $message = null) { 166 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); 167 | } 168 | 169 | 170 | /** 171 | * [!] Method is generated. Documentation taken from corresponding module. 172 | * 173 | * Checks that string match with pattern 174 | * 175 | * @param string $pattern 176 | * @param string $string 177 | * @param string $message 178 | * @see \Codeception\Module\Asserts::assertRegExp() 179 | */ 180 | public function assertRegExp($pattern, $string, $message = null) { 181 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args())); 182 | } 183 | 184 | 185 | /** 186 | * [!] Method is generated. Documentation taken from corresponding module. 187 | * 188 | * Checks that string not match with pattern 189 | * 190 | * @param string $pattern 191 | * @param string $string 192 | * @param string $message 193 | * @see \Codeception\Module\Asserts::assertNotRegExp() 194 | */ 195 | public function assertNotRegExp($pattern, $string, $message = null) { 196 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args())); 197 | } 198 | 199 | 200 | /** 201 | * [!] Method is generated. Documentation taken from corresponding module. 202 | * 203 | * Checks that variable is empty. 204 | * 205 | * @param $actual 206 | * @param string $message 207 | * @see \Codeception\Module\Asserts::assertEmpty() 208 | */ 209 | public function assertEmpty($actual, $message = null) { 210 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); 211 | } 212 | 213 | 214 | /** 215 | * [!] Method is generated. Documentation taken from corresponding module. 216 | * 217 | * Checks that variable is not empty. 218 | * 219 | * @param $actual 220 | * @param string $message 221 | * @see \Codeception\Module\Asserts::assertNotEmpty() 222 | */ 223 | public function assertNotEmpty($actual, $message = null) { 224 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); 225 | } 226 | 227 | 228 | /** 229 | * [!] Method is generated. Documentation taken from corresponding module. 230 | * 231 | * Checks that variable is NULL 232 | * 233 | * @param $actual 234 | * @param string $message 235 | * @see \Codeception\Module\Asserts::assertNull() 236 | */ 237 | public function assertNull($actual, $message = null) { 238 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); 239 | } 240 | 241 | 242 | /** 243 | * [!] Method is generated. Documentation taken from corresponding module. 244 | * 245 | * Checks that variable is not NULL 246 | * 247 | * @param $actual 248 | * @param string $message 249 | * @see \Codeception\Module\Asserts::assertNotNull() 250 | */ 251 | public function assertNotNull($actual, $message = null) { 252 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); 253 | } 254 | 255 | 256 | /** 257 | * [!] Method is generated. Documentation taken from corresponding module. 258 | * 259 | * Checks that condition is positive. 260 | * 261 | * @param $condition 262 | * @param string $message 263 | * @see \Codeception\Module\Asserts::assertTrue() 264 | */ 265 | public function assertTrue($condition, $message = null) { 266 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); 267 | } 268 | 269 | 270 | /** 271 | * [!] Method is generated. Documentation taken from corresponding module. 272 | * 273 | * Checks that condition is negative. 274 | * 275 | * @param $condition 276 | * @param string $message 277 | * @see \Codeception\Module\Asserts::assertFalse() 278 | */ 279 | public function assertFalse($condition, $message = null) { 280 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); 281 | } 282 | 283 | 284 | /** 285 | * [!] Method is generated. Documentation taken from corresponding module. 286 | * 287 | * Checks if file exists 288 | * 289 | * @param string $filename 290 | * @param string $message 291 | * @see \Codeception\Module\Asserts::assertFileExists() 292 | */ 293 | public function assertFileExists($filename, $message = null) { 294 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args())); 295 | } 296 | 297 | 298 | /** 299 | * [!] Method is generated. Documentation taken from corresponding module. 300 | * 301 | * Checks if file doesn't exist 302 | * 303 | * @param string $filename 304 | * @param string $message 305 | * @see \Codeception\Module\Asserts::assertFileNotExists() 306 | */ 307 | public function assertFileNotExists($filename, $message = null) { 308 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args())); 309 | } 310 | 311 | 312 | /** 313 | * [!] Method is generated. Documentation taken from corresponding module. 314 | * 315 | * @param $expected 316 | * @param $actual 317 | * @param $description 318 | * @see \Codeception\Module\Asserts::assertGreaterOrEquals() 319 | */ 320 | public function assertGreaterOrEquals($expected, $actual, $description = null) { 321 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args())); 322 | } 323 | 324 | 325 | /** 326 | * [!] Method is generated. Documentation taken from corresponding module. 327 | * 328 | * @param $expected 329 | * @param $actual 330 | * @param $description 331 | * @see \Codeception\Module\Asserts::assertLessOrEquals() 332 | */ 333 | public function assertLessOrEquals($expected, $actual, $description = null) { 334 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args())); 335 | } 336 | 337 | 338 | /** 339 | * [!] Method is generated. Documentation taken from corresponding module. 340 | * 341 | * @param $actual 342 | * @param $description 343 | * @see \Codeception\Module\Asserts::assertIsEmpty() 344 | */ 345 | public function assertIsEmpty($actual, $description = null) { 346 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args())); 347 | } 348 | 349 | 350 | /** 351 | * [!] Method is generated. Documentation taken from corresponding module. 352 | * 353 | * @param $key 354 | * @param $actual 355 | * @param $description 356 | * @see \Codeception\Module\Asserts::assertArrayHasKey() 357 | */ 358 | public function assertArrayHasKey($key, $actual, $description = null) { 359 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args())); 360 | } 361 | 362 | 363 | /** 364 | * [!] Method is generated. Documentation taken from corresponding module. 365 | * 366 | * @param $key 367 | * @param $actual 368 | * @param $description 369 | * @see \Codeception\Module\Asserts::assertArrayNotHasKey() 370 | */ 371 | public function assertArrayNotHasKey($key, $actual, $description = null) { 372 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args())); 373 | } 374 | 375 | 376 | /** 377 | * [!] Method is generated. Documentation taken from corresponding module. 378 | * 379 | * @param $expectedCount 380 | * @param $actual 381 | * @param $description 382 | * @see \Codeception\Module\Asserts::assertCount() 383 | */ 384 | public function assertCount($expectedCount, $actual, $description = null) { 385 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args())); 386 | } 387 | 388 | 389 | /** 390 | * [!] Method is generated. Documentation taken from corresponding module. 391 | * 392 | * @param $class 393 | * @param $actual 394 | * @param $description 395 | * @see \Codeception\Module\Asserts::assertInstanceOf() 396 | */ 397 | public function assertInstanceOf($class, $actual, $description = null) { 398 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args())); 399 | } 400 | 401 | 402 | /** 403 | * [!] Method is generated. Documentation taken from corresponding module. 404 | * 405 | * @param $class 406 | * @param $actual 407 | * @param $description 408 | * @see \Codeception\Module\Asserts::assertNotInstanceOf() 409 | */ 410 | public function assertNotInstanceOf($class, $actual, $description = null) { 411 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args())); 412 | } 413 | 414 | 415 | /** 416 | * [!] Method is generated. Documentation taken from corresponding module. 417 | * 418 | * @param $type 419 | * @param $actual 420 | * @param $description 421 | * @see \Codeception\Module\Asserts::assertInternalType() 422 | */ 423 | public function assertInternalType($type, $actual, $description = null) { 424 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args())); 425 | } 426 | 427 | 428 | /** 429 | * [!] Method is generated. Documentation taken from corresponding module. 430 | * 431 | * Fails the test with message. 432 | * 433 | * @param $message 434 | * @see \Codeception\Module\Asserts::fail() 435 | */ 436 | public function fail($message) { 437 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args())); 438 | } 439 | 440 | 441 | /** 442 | * [!] Method is generated. Documentation taken from corresponding module. 443 | * 444 | * Handles and checks exception called inside callback function. 445 | * Either exception class name or exception instance should be provided. 446 | * 447 | * ```php 448 | * expectException(MyException::class, function() { 450 | * $this->doSomethingBad(); 451 | * }); 452 | * 453 | * $I->expectException(new MyException(), function() { 454 | * $this->doSomethingBad(); 455 | * }); 456 | * ``` 457 | * If you want to check message or exception code, you can pass them with exception instance: 458 | * ```php 459 | * expectException(new MyException("Don't do bad things"), function() { 462 | * $this->doSomethingBad(); 463 | * }); 464 | * ``` 465 | * 466 | * @param $exception string or \Exception 467 | * @param $callback 468 | * @see \Codeception\Module\Asserts::expectException() 469 | */ 470 | public function expectException($exception, $callback) { 471 | return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args())); 472 | } 473 | } 474 | -------------------------------------------------------------------------------- /tests/acceptance.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for acceptance tests. 4 | # Perform tests in browser using the WebDriver or PhpBrowser. 5 | # If you need both WebDriver and PHPBrowser tests - create a separate suite. 6 | 7 | class_name: AcceptanceTester 8 | modules: 9 | enabled: 10 | - Asserts 11 | - \Helper\Acceptance 12 | - PhpBrowser: 13 | # url: &url http://localhost:8080/v1/ # stock testing location 14 | url: &url http://172.17.0.1:8080/v1/ # use this is testing from INSIDE the container 15 | - REST: 16 | depends: PhpBrowser 17 | url: *url -------------------------------------------------------------------------------- /tests/acceptance/AllQueriesActiveModelCept.php: -------------------------------------------------------------------------------- 1 | wantTo('Test query abilities of all api end points'); 11 | 12 | $endpoints = array( 13 | 'addresses', 14 | 'customers', 15 | 'users' 16 | ); 17 | 18 | foreach ($endpoints as $endpoint) { 19 | $I->sendGet("$endpoint?limit=2"); 20 | $I->seeResponseCodeIs(200); 21 | $I->seeResponseIsJson(); 22 | 23 | $newID = $I->grabDataFromResponseByJsonPath("$.data[0].id"); 24 | 25 | // test calling an individual resource 26 | $I->sendGet($endpoint . '/' . $newID[0]); 27 | $I->seeResponseCodeIs(200); 28 | $I->seeResponseIsJson(); 29 | 30 | // test offset 31 | $I->sendGet("$endpoint?limit=2&offset=2"); 32 | $I->seeResponseCodeIs(200); 33 | $I->seeResponseIsJson(); 34 | $I->seeResponseJsonMatchesJsonPath("$.data[0].id"); 35 | 36 | // run searches side loading all records 37 | $I->sendGet("$endpoint?limit=2&offset=2&with=all"); 38 | $I->seeResponseCodeIs(200); 39 | $I->seeResponseIsJson(); 40 | $I->seeResponseJsonMatchesJsonPath("$.included[0].id"); 41 | } -------------------------------------------------------------------------------- /tests/acceptance/_bootstrap.php: -------------------------------------------------------------------------------- 1 |