This document provides a summary of hidden features in PHP as presented by Ilia Alshanetsky at the 2011 International PHP Conference. Some key features discussed include the __DIR__ magic constant for determining the path of a PHP script, the ?: operator for retrieving the first non-empty value from two expressions, new encryption functions, improvements to date parsing, using FileInfo for reliable file identification, and extensions like StatGrab and MailParse that provide system information and email parsing capabilities. The document is formatted as a slide presentation with code examples demonstrating usage of these PHP features.
international PHP2011_ilia alshanetsky_Hidden Features of PHPsmueller_sandsmedia
This document provides a summary of hidden features in PHP presented by Ilia Alshanetsky at an international PHP conference in 2011. It discusses magic constants like __DIR__, the ternary operator, encryption functions, preventing double encoding with htmlspecialchars(), parsing dates, resolving include paths, session initialization options, hashing, file system traversal with SPL, faster serialization with igbinary, identifying file types with FileInfo, system monitoring with StatGrab, parsing emails with MailParse, and more. The presentation provides code examples and explanations for many undocumented or lesser known PHP features.
The document discusses the Standard PHP Library (SPL) which provides common data structures and interfaces in PHP. It describes various iterator interfaces and classes that can be used to iterate over data in a consistent manner. These include interfaces like Iterator and classes like RecursiveIteratorIterator, FilterIterator, ArrayIterator, DirectoryIterator, and SplFileInfo. It also discusses other SPL components like exceptions, autoloading functions, and data structures.
This document provides an overview of the Standard PHP Library (SPL) including common data structures like stacks, queues, heaps and iterators. It discusses how SPL extensions like SplSubject and SplObserver can be used to implement observer patterns. Various real-world open source projects using SPL are cited as examples. The document encourages involvement in improving and expanding SPL through code contributions and community engagement.
Writing and using php streams and sockets tek11Elizabeth Smith
Streams provide a generic way to access input and output in PHP and were originally introduced in the 1950s as a standard way to handle input/output. PHP implements streams using wrappers that tell streams how to handle specific protocols and encodings, and filters that can transform stream data. Common stream wrappers in PHP include file, http, ftp, and php streams for interacting with system inputs and outputs.
The document provides an overview of Symfony2, an open-source PHP web application framework. It describes Symfony2 as a set of decoupled and cohesive components including routing, templating, form handling, and more. It also outlines Symfony2's support for modern best practices like dependency injection and an object-oriented approach to web application development using the Model-View-Controller pattern.
international PHP2011_ilia alshanetsky_Hidden Features of PHPsmueller_sandsmedia
This document provides a summary of hidden features in PHP presented by Ilia Alshanetsky at an international PHP conference in 2011. It discusses magic constants like __DIR__, the ternary operator, encryption functions, preventing double encoding with htmlspecialchars(), parsing dates, resolving include paths, session initialization options, hashing, file system traversal with SPL, faster serialization with igbinary, identifying file types with FileInfo, system monitoring with StatGrab, parsing emails with MailParse, and more. The presentation provides code examples and explanations for many undocumented or lesser known PHP features.
The document discusses the Standard PHP Library (SPL) which provides common data structures and interfaces in PHP. It describes various iterator interfaces and classes that can be used to iterate over data in a consistent manner. These include interfaces like Iterator and classes like RecursiveIteratorIterator, FilterIterator, ArrayIterator, DirectoryIterator, and SplFileInfo. It also discusses other SPL components like exceptions, autoloading functions, and data structures.
This document provides an overview of the Standard PHP Library (SPL) including common data structures like stacks, queues, heaps and iterators. It discusses how SPL extensions like SplSubject and SplObserver can be used to implement observer patterns. Various real-world open source projects using SPL are cited as examples. The document encourages involvement in improving and expanding SPL through code contributions and community engagement.
Writing and using php streams and sockets tek11Elizabeth Smith
Streams provide a generic way to access input and output in PHP and were originally introduced in the 1950s as a standard way to handle input/output. PHP implements streams using wrappers that tell streams how to handle specific protocols and encodings, and filters that can transform stream data. Common stream wrappers in PHP include file, http, ftp, and php streams for interacting with system inputs and outputs.
The document provides an overview of Symfony2, an open-source PHP web application framework. It describes Symfony2 as a set of decoupled and cohesive components including routing, templating, form handling, and more. It also outlines Symfony2's support for modern best practices like dependency injection and an object-oriented approach to web application development using the Model-View-Controller pattern.
This document discusses using PHP for both web and desktop applications. It introduces PHP-GTK, which allows PHP to create graphical desktop applications with a native look and feel across platforms. It provides examples of creating windows, containers, working with signals and the main loop. The document also discusses installing PHP-GTK, some key considerations for desktop applications, and examples of creating widgets like trees and working with models.
This document provides information about Javier Eguiluz, a programmer and trainer from Spain who specializes in Symfony and Twig. It outlines his experience with Symfony and as the author of a popular Symfony book. The agenda covers tips, tricks, advanced features, best practices and new noteworthy features of the Twig templating engine.
The document provides an overview of the Symfony2 framework from its creator Fabien Potencier. It discusses several key aspects in 3 or less sentences:
- Symfony2 is not yet ready for production but is estimated to reach stable status in March 2011. Some developers are already using pre-release versions.
- The translation component allows translating text and handling pluralization. Template engines like Twig can be used to integrate translations into views.
- Forms can be customized by overriding rendering blocks for different field types in custom templates applied to individual forms or globally.
- Security features like authentication, authorization, and protecting against attacks are integrated. Users can be loaded from different
Back in the ’40s, Samuel Eilenberg and Saunders Mac Lane started developing an entire new branch of mathematics: Category Theory. This was 10 years after Lambda calculus and 10 years before Lisp. Mathematics offers a powerful and concise language; we can represent a lot of complexity with short equations like E=mc2.
This session will explore how programming can harness maths’ capacity for conciseness and expression, borrowing from Category Theory. We’ll discover algebraic data types that can impact the way we code tremendously. You’ll also learn about functors, monads, applicatives, semigroups and monoids and how they can be used in a PHP context.
This document provides biographical information about Fabien Potencier and discusses his upcoming presentation titled "PHP 5.3 in practice". It notes that Fabien is the founder of Sensio, a consulting company specialized in web technologies, and the creator of several open source projects including Symfony. The presentation will cover reasons for migrating to PHP 5.3 such as improved speed and lower memory usage, how PHP 5.3 affects design patterns like the singleton, and new features like namespaces and anonymous functions.
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
My slides on PHPSpec 2 from Symfony November Camp Stockholm.
www.symfony.se/november-camp/
More Domain-Driven Design related content at: https://domaincentric.net/
New Symfony Tips & Tricks (SymfonyCon Paris 2015)Javier Eguiluz
This talk included tens of tips and tricks, new features and rarely used options for Symfony and its ecosystem. Besides the full-stack Symfony framework, other related technologies were mentioned, like Doctrine, Composer, Twig, PHPUnit and Monolog.
The document discusses new features and changes in Puppet 4, including Puppet Server running on JVM, packaging improvements, environment configuration options, language features like lambdas and HEREDOC support, type validation, and deprecations like node inheritance and hyphens in names. It highlights four key powers of Puppet 4: performance, scalability, measurability, and flexibility in dealing with complex data types natively. Upgrading to Puppet 4 requires changes to comply with deprecations and testing to ensure compatibility.
A reusable Puppet module should provide options and flexibility for configuration through parameters rather than being overly prescriptive. This allows users to customize the module for their specific needs. Parameters can control things like file management, package/service options, additional resources, and application configuration. Using patterns like default parameters, options hashes, and templates helps keep modules reusable and configurable.
The document discusses building REST APIs in Flask. It introduces REST concepts and how Flask supports REST. Validation of resources can be done with Trafaret. The document demonstrates creating API resources with Flask extensions that support validation, authentication decorators, and modeling SQL Alchemy classes. Future work includes adding filtering, caching, throttling and customizing fields for modeled resources.
Correctly understanding the eight data types in PHP is essential to a solid foundation in development. Come refresh your knowledge of the scalar types, compound types, and special data types used in PHP, and learn about proper usage of each. Review type juggling, learn some common data type traps to avoid, and how to code defensively to prevent having the data type of a variable change unexpectedly. Finally learn how unit tests can help verify that code is handling data types correctly.
From Tek-X Cross Platform interoperability with PHP including history lesson, a bit about each category of operating systems, and gotchas related to PHP
Fabien Potencier began work on Symfony 2 two years ago with a new code base, but realized starting from scratch required too much work. He incorporated ideas tested in the new code base back into Symfony 1. Symfony 2 will be an evolution of Symfony 1, adding new libraries like a dependency injection container and template layer while maintaining compatibility. It will learn from other projects like Rails, Spring, and Django. Symfony 2 focuses on reusability through a new service container that enables dependency injection and configuration of core components.
Vaadin is a Java-based web application framework that allows building rich client-side web applications using server-side Java and client-side JavaScript. Some key points:
- It uses server-side Java and the GWT compiler to generate lightweight JavaScript widgets for the client-side UI.
- This allows building complex, responsive UIs with a desktop-like experience using standard Java/GWT components on the server side.
- Over 100,000 developers use Vaadin across industries like finance, healthcare, government to build applications for Fortune 500 companies and startups.
PHP and MySQL are open-source technologies commonly used together for building dynamic web applications. PHP is a server-side scripting language designed to integrate with MySQL databases. Key features include using PHP scripts embedded in HTML, variables to store and manipulate data, functions to reuse code, and MySQL functions to connect to databases and execute queries.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
Les slides du Tools in Action que j'ai donné à Devoxx France 2019.
Le JDK est open source et son développement aussi. L'ensemble des nouveautés vit sur des branches Mercurial qui peuvent être téléchargées et compilées à la demande. Cela permet de jouer avec des fonctionnalités encore en chantier, de regarder comment les nouvelles syntaxes fonctionneront, bref, de jouer avec un JDK du futur, qui n'existera peut-être jamais. L'objet de ce tools in action est simple : montrer comment tout ceci fonctionne, de l'installation d'une machine Ubuntu à l'exécution d'un JDK recompilé maison.
The document discusses unit testing Zend Framework applications. It provides an overview of setting up PHPUnit for testing, including creating a phpunit.xml file and TestHelper bootstrap file. It also discusses testing Zend Forms and Models, including writing tests to validate form data and test that models are empty on construction. Code examples are provided for writing tests for a CommentForm and CommentModel class.
La Municipalidad de San Luis inaugurará el próximo jueves el Boulevard de los Jacarandaes, que es la refuncionalización de la Avenida Illia. Se realizarán diversas actividades para conmemorar la obra e inaugurar el nuevo boulevard. También se anuncia la próxima etapa de la obra que incluirá la refuncionalización del predio del ex edificio de la estación de trenes y la ampliación de la Avenida Illia.
Esta empresa joven ayuda a otras empresas a mejorar su posicionamiento y presencia en el mercado a través de estrategias creativas y productos novedosos, con un enfoque en el diseño y preguntas estratégicas. Ofrecen servicios como desarrollo web, publicidad en línea, correos masivos, productos promocionales, diseño corporativo y estrategia.
This document discusses using PHP for both web and desktop applications. It introduces PHP-GTK, which allows PHP to create graphical desktop applications with a native look and feel across platforms. It provides examples of creating windows, containers, working with signals and the main loop. The document also discusses installing PHP-GTK, some key considerations for desktop applications, and examples of creating widgets like trees and working with models.
This document provides information about Javier Eguiluz, a programmer and trainer from Spain who specializes in Symfony and Twig. It outlines his experience with Symfony and as the author of a popular Symfony book. The agenda covers tips, tricks, advanced features, best practices and new noteworthy features of the Twig templating engine.
The document provides an overview of the Symfony2 framework from its creator Fabien Potencier. It discusses several key aspects in 3 or less sentences:
- Symfony2 is not yet ready for production but is estimated to reach stable status in March 2011. Some developers are already using pre-release versions.
- The translation component allows translating text and handling pluralization. Template engines like Twig can be used to integrate translations into views.
- Forms can be customized by overriding rendering blocks for different field types in custom templates applied to individual forms or globally.
- Security features like authentication, authorization, and protecting against attacks are integrated. Users can be loaded from different
Back in the ’40s, Samuel Eilenberg and Saunders Mac Lane started developing an entire new branch of mathematics: Category Theory. This was 10 years after Lambda calculus and 10 years before Lisp. Mathematics offers a powerful and concise language; we can represent a lot of complexity with short equations like E=mc2.
This session will explore how programming can harness maths’ capacity for conciseness and expression, borrowing from Category Theory. We’ll discover algebraic data types that can impact the way we code tremendously. You’ll also learn about functors, monads, applicatives, semigroups and monoids and how they can be used in a PHP context.
This document provides biographical information about Fabien Potencier and discusses his upcoming presentation titled "PHP 5.3 in practice". It notes that Fabien is the founder of Sensio, a consulting company specialized in web technologies, and the creator of several open source projects including Symfony. The presentation will cover reasons for migrating to PHP 5.3 such as improved speed and lower memory usage, how PHP 5.3 affects design patterns like the singleton, and new features like namespaces and anonymous functions.
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
My slides on PHPSpec 2 from Symfony November Camp Stockholm.
www.symfony.se/november-camp/
More Domain-Driven Design related content at: https://domaincentric.net/
New Symfony Tips & Tricks (SymfonyCon Paris 2015)Javier Eguiluz
This talk included tens of tips and tricks, new features and rarely used options for Symfony and its ecosystem. Besides the full-stack Symfony framework, other related technologies were mentioned, like Doctrine, Composer, Twig, PHPUnit and Monolog.
The document discusses new features and changes in Puppet 4, including Puppet Server running on JVM, packaging improvements, environment configuration options, language features like lambdas and HEREDOC support, type validation, and deprecations like node inheritance and hyphens in names. It highlights four key powers of Puppet 4: performance, scalability, measurability, and flexibility in dealing with complex data types natively. Upgrading to Puppet 4 requires changes to comply with deprecations and testing to ensure compatibility.
A reusable Puppet module should provide options and flexibility for configuration through parameters rather than being overly prescriptive. This allows users to customize the module for their specific needs. Parameters can control things like file management, package/service options, additional resources, and application configuration. Using patterns like default parameters, options hashes, and templates helps keep modules reusable and configurable.
The document discusses building REST APIs in Flask. It introduces REST concepts and how Flask supports REST. Validation of resources can be done with Trafaret. The document demonstrates creating API resources with Flask extensions that support validation, authentication decorators, and modeling SQL Alchemy classes. Future work includes adding filtering, caching, throttling and customizing fields for modeled resources.
Correctly understanding the eight data types in PHP is essential to a solid foundation in development. Come refresh your knowledge of the scalar types, compound types, and special data types used in PHP, and learn about proper usage of each. Review type juggling, learn some common data type traps to avoid, and how to code defensively to prevent having the data type of a variable change unexpectedly. Finally learn how unit tests can help verify that code is handling data types correctly.
From Tek-X Cross Platform interoperability with PHP including history lesson, a bit about each category of operating systems, and gotchas related to PHP
Fabien Potencier began work on Symfony 2 two years ago with a new code base, but realized starting from scratch required too much work. He incorporated ideas tested in the new code base back into Symfony 1. Symfony 2 will be an evolution of Symfony 1, adding new libraries like a dependency injection container and template layer while maintaining compatibility. It will learn from other projects like Rails, Spring, and Django. Symfony 2 focuses on reusability through a new service container that enables dependency injection and configuration of core components.
Vaadin is a Java-based web application framework that allows building rich client-side web applications using server-side Java and client-side JavaScript. Some key points:
- It uses server-side Java and the GWT compiler to generate lightweight JavaScript widgets for the client-side UI.
- This allows building complex, responsive UIs with a desktop-like experience using standard Java/GWT components on the server side.
- Over 100,000 developers use Vaadin across industries like finance, healthcare, government to build applications for Fortune 500 companies and startups.
PHP and MySQL are open-source technologies commonly used together for building dynamic web applications. PHP is a server-side scripting language designed to integrate with MySQL databases. Key features include using PHP scripts embedded in HTML, variables to store and manipulate data, functions to reuse code, and MySQL functions to connect to databases and execute queries.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
Les slides du Tools in Action que j'ai donné à Devoxx France 2019.
Le JDK est open source et son développement aussi. L'ensemble des nouveautés vit sur des branches Mercurial qui peuvent être téléchargées et compilées à la demande. Cela permet de jouer avec des fonctionnalités encore en chantier, de regarder comment les nouvelles syntaxes fonctionneront, bref, de jouer avec un JDK du futur, qui n'existera peut-être jamais. L'objet de ce tools in action est simple : montrer comment tout ceci fonctionne, de l'installation d'une machine Ubuntu à l'exécution d'un JDK recompilé maison.
The document discusses unit testing Zend Framework applications. It provides an overview of setting up PHPUnit for testing, including creating a phpunit.xml file and TestHelper bootstrap file. It also discusses testing Zend Forms and Models, including writing tests to validate form data and test that models are empty on construction. Code examples are provided for writing tests for a CommentForm and CommentModel class.
La Municipalidad de San Luis inaugurará el próximo jueves el Boulevard de los Jacarandaes, que es la refuncionalización de la Avenida Illia. Se realizarán diversas actividades para conmemorar la obra e inaugurar el nuevo boulevard. También se anuncia la próxima etapa de la obra que incluirá la refuncionalización del predio del ex edificio de la estación de trenes y la ampliación de la Avenida Illia.
Esta empresa joven ayuda a otras empresas a mejorar su posicionamiento y presencia en el mercado a través de estrategias creativas y productos novedosos, con un enfoque en el diseño y preguntas estratégicas. Ofrecen servicios como desarrollo web, publicidad en línea, correos masivos, productos promocionales, diseño corporativo y estrategia.
This document outlines the chapters and topics covered in a Networking Essentials assignment, including basics of computer networks, email clients, the OSI model, transmission media, networking devices, network topologies, local area networks, IP addressing, TCP/IP protocols, Ethernet standards, installing networks, wireless networking, internet connections, and troubleshooting network problems. It contains over 200 questions and discussion points across 14 chapters related to networking concepts, configurations, and issues.
La resolución aprueba el reglamento de operatividad y funcionamiento del terminal terrestre interdistrital La Rinconada en Ayaviri, Puno. El reglamento establece las definiciones, objetivos y base legal para regular el funcionamiento del terminal y el servicio de transporte público interurbano. También determina las atribuciones de la municipalidad provincial de Melgar para la administración del terminal.
Este documento presenta información sobre el Examen General para el Egreso de la Licenciatura en Ingeniería Electrónica (EGEL-IELECTRO) aplicado por el Centro Nacional de Evaluación para la Educación Superior (Ceneval). Incluye secciones sobre administración de sistemas electrónicos, operación y mantenimiento, ingeniería económica, diseño e integración de sistemas, comunicaciones y líneas de transmisión. El documento es un recurso de apoyo para los estudiantes que presentarán el examen y está sujeto a revisiones
Think better, not more. Strategisches Content Marketing mit dem SCOM Framework.ScribbleLive
Ausführliches E-Book über die Bedeutung von "Strategischem Content Marketing" in Abgrenzung zu Content Marketing als Marketing Technik bei Inbound Marketing, SEO oder Social Media. Mit ausführlicher Beschreibung des Content-Radars, des FISH-Modells und der Persona Erstellung nach "Think Limbic"
The document discusses Node.js and how it can be used to build server-side applications using JavaScript. Some key points include:
- Node.js allows for non-blocking, asynchronous programming which improves performance compared to traditional blocking I/O.
- It uses a single thread with event loops to handle multiple connections concurrently without blocking.
- JavaScript is a good choice as it is the language of the web and supports features like closures that are useful for asynchronous programming.
- Node.js has gained popularity due to its ability to build high performance web servers using a non-blocking approach that is accessible to programmers without expertise in asynchronous programming.
The document discusses Node.js and how it can be used to build server-side applications using JavaScript. Some key points include:
- Node.js allows for non-blocking asynchronous programming which improves performance over traditional blocking servers.
- It uses a single thread event loop model that handles all I/O asynchronously, avoiding context switching.
- JavaScript is the language of the web and Node.js allows using JavaScript on the server side for building real-time applications.
- Node.js has an active community and growing ecosystem of packages on npm that can be easily installed and used in applications.
The document is a presentation about the Solar PHP framework from 2011. It summarizes that Solar was one of the first frameworks for PHP 5 that pre-dated the Zend Framework. It describes Solar's foundational concepts like following PEAR standards, using a unified constructor and configuration, and techniques like dependency injection. The presentation provides examples of how these concepts are implemented in Solar.
Javascript - How to avoid the bad partsMikko Ohtamaa
The document discusses best practices for writing JavaScript code, including using Require.js for module loading, ECMAScript5 features for compatibility and features, strict mode, linting tools like JSLint, avoiding inline JavaScript, event handling best practices, function binding, and resources for learning JavaScript. The conclusion emphasizes that while JavaScript still lacks some modern features, following best practices can avoid many issues and tools exist to work around remaining limitations.
The document summarizes some of the new features introduced in Java 7. It discusses binary literals, underscores in numeric literals, strings in switch statements, automatic resource management using try-with-resources, multi-catch exceptions, more precise rethrowing of exceptions, diamond operator for generic types, varargs warnings and suppression, Java NIO.2 features for file navigation, directories, symbolic links, and walking file trees. The document provides examples and explanations of how to use these new Java 7 language features.
The document discusses various techniques for optimizing website performance, including respecting HTTP protocols like using GET requests for non-destructive actions; using a proxy server like Nginx to deliver static content; leveraging caching, compression, and content delivery networks; JavaScript and image optimizations; and asynchronous loading of scripts. The goal is to make websites faster by improving how static assets are served and how client-server interactions work.
Do you write JavaScript? Congratulations, you're probably awesome at Node.js! While thinking about things from a server-side perspective might feel off-putting and unnatural, things like callbacks, storing data in JSON, and implementing actual websites probably do not. We'll go beyond getting Node installed and talk about how to quickly build a working web application, and demonstrate that Node can offer frontend developers more than just a new prototyping tool or way of creating endless chat servers.
A couple of tricks you might not know about. Held at an internal developer show'n'tell in October 2010 at SilverStripe Ltd. in Wellington, New Zealand. Video available at http://vimeo.com/16446690
The document discusses using APC (Alternative PHP Cache) and Memcached together for high performance caching. It provides an overview of APC for opcode and user caching and how it can accelerate PHP script performance. Memcached is presented as an alternative for user caching that offers a distributed caching system accessible from PHP through an object-oriented interface. Examples are given for basic usage of storing, retrieving, and deleting from the caches. Features like multi-server environments, data segmentation, and delayed data retrieval with Memcached are also covered.
This document summarizes Eric Holscher's talk on safely deploying software on the cutting edge. The talk discusses Urban Airship's deployment process, including using Git for version control, maintaining a QA environment, designing services as composable pieces, and automating deployments using tools like Fabric. It also covers verifying deployments by routing traffic to new instances and checking metrics to identify issues before notifying customers.
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016Codemotion
In this talk I'll present some of the new features of PHP 7. I will present the scalar type and return type declarations, the spaceship and null coalescing operators, the anonymous classes, the new Error exception, the security features, etc. Moreover, I will present some benchmarks and use cases of PHP 7 regarding the huge performance improvement.
Presented at Codemotion 2016. Discusses the beginner-level dynamics of the performance-improved PHP 7. Gain expanded knowledge of the spaceship and null coalescing operators, anonymous classes, the new error exception, and the security features of PHP 7.
Shell Scripts for Oracle Database and E-Business Suite.pdfAkhashRamnath
This document provides shell scripts for monitoring an Oracle database and E-Business Suite environment. It includes scripts to check the database instance availability, listener availability, tablespace space usage, errors in the alert log, and blocking sessions. Instructions are provided on setting up a common environment file and log directory for the scripts. The scripts will send alerts via email to notify administrators if any issues are detected.
This document provides an introduction to PHP for beginners. It covers the basics of PHP syntax, variables, arrays, functions, interacting with URLs, loading content from external websites, displaying XML and JSON data, and connecting to a MySQL database. Code samples and links for further reference are included to demonstrate common PHP tasks.
The document discusses hidden features of PHP, including the __DIR__ magic constant for retrieving the directory of a script, the ?? operator for retrieving a non-empty value from expressions, using GOTO for error handling, OpenSSL functions for hashing, encryption and decryption, preventing double encoding with HTML entities functions, date parsing, finding files with stream_resolve_include_path, improving session security, mail logging, directory traversal with SPL iterators, using igbinary for faster serialization, profiling with xhprof, identifying file types with fileinfo, and creating and reading Excel files with PHP-Excel.
"What To Expect From PHP7" by Lorna Mitchell
We have a new major release of PHP! But what does this mean for PHP developers in the Real World (TM)? This talk has everything you need to know to be the expert. Find out how the remarkable performance improvements could look on your own system, and see the shiny new features in this major release of the web's favourite scripting language. Get advice on how to upgrade your application, making use of the new features and avoiding the backwards compatibility traps. Developers and technical leaders everywhere who want to use better PHP will benefit from this session.
With PHP 5.4 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.3 and 5.4 and how to get code ready for the latest version of PHP. In this talk, we'll migrate an old piece of code using some standard and some very non-standard tools and techniques.
This document contains the slides from a presentation given by Mike Hostetler on December 6, 2011 titled "StarTechConf 2011". The presentation introduces jQuery, covering topics such as including jQuery, selecting elements, manipulating styles, chaining methods, DOM manipulation, and binding events. Examples are provided throughout to demonstrate jQuery syntax and functionality.
MongoDB at Sailthru: Scaling and Schema DesignDATAVERSITY
Sailthru provides all your website email delivery needs, ensuring Inbox delivery for transactional and mass mail. Sailthru started out as a MySQL-powered transactional-mail service. Starting in 2009, we migrated to the document-oriented "nosql" database MongoDB. Moving entirely to MongoDB has allowed us to build complex user profiles to power behavioral-targeted mass emails and onsite recommendations. How and why we made the move, and how we use MongoDB today.
The document introduces PHP as a server-side scripting language that is easy to learn and commonly used with the LAMP stack. It provides examples of basic PHP syntax for variables, arrays, functions, and interacting with URLs and external data sources. The goal is to teach enough PHP to handle simple requests and parse/generate XML and JSON through practical code examples.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxEduSkills OECD
Iván Bornacelly, Policy Analyst at the OECD Centre for Skills, OECD, presents at the webinar 'Tackling job market gaps with a skills-first approach' on 12 June 2024
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
잘 알려지지 않은 Php 코드 활용하기
1. Hidden Features
of PHP
International PHP Conference 2011
Ilia Alshanetsky
@iliaa
Wednesday, June 1, 2011 1
2. root@foo $: whois ilia
PHP: Core Developer Since 2001
Release Manager of 4.3, 5.1 and 5.2 branches
Author of a “few” extensions
Work: CIO at Centah Inc.
Hobbies: Photography, Biking
Dev. Interests: Performance & Security
Wednesday, June 1, 2011 2
3. __DIR__ Magic
The __DIR__ constant is a simple and fast
solution to the “where am i?” question for PHP
scripts.
ilia@s3 /tmp $ php a.php
<?php echo __DIR__;
/tmp
Wednesday, June 1, 2011 3
4. We Perl
Allows quick retrieval of a non-empty value from
2 values and/or expressions
$a = true ?: false; // true
$a = false ?: true; // true
$a = "" ?: 1; // 1
$a = 0 ?: 2; // 2
$a = array() ?: array(1); // array(1)
$a = strlen("") ?: strlen("a"); // 1
** The variable or array key must exist
Wednesday, June 1, 2011 4
5. GOTO ...
restart:
if (error_condition1) {
goto error;
}
if (error_condition2) {
goto restart;
}
error:
report_error();
exit;
My favourite 5.3 feature ;-)
Wednesday, June 1, 2011 5
7. Double Encoding
Prevent double encoding of html-entities via 4th
argument to htmlspecialchars() and htmlentities()
$foo = "bar > foo & that"s all";
htmlspecialchars($foo, ENT_COMPAT, 'UTF-8');
htmlentities($foo, ENT_COMPAT, 'UTF-8');
bar > foo &amp; that&quot;s all
Wednesday, June 1, 2011 7
8. Double Encoding
Prevent double encoding of html-entities via 4th
argument to htmlspecialchars() and htmlentities()
$foo = "bar > foo & that"s all";
htmlspecialchars($foo, ENT_COMPAT, 'UTF-8');
htmlentities($foo, ENT_COMPAT, 'UTF-8');
bar > foo &amp; that&quot;s all
htmlspecialchars($foo, ENT_COMPAT, 'UTF-8', false);
htmlentities($foo, ENT_COMPAT, 'UTF-8', false);
bar > foo & that"s all
Wednesday, June 1, 2011 7
9. Date Parsing
October 5, 2012
05-10-12 May 10, 2012
December 10, 2005
Wednesday, June 1, 2011 8
10. Date Parsing
October 5, 2012
05-10-12 May 10, 2012
December 10, 2005
Wednesday, June 1, 2011 8
11. Date Parsing
October 5, 2012
05-10-12 May 10, 2012
December 10, 2005
$date =
date_create_from_format('y-m-d', '05-10-12');
var_dump(date_format($date, 'F d, Y'));
string(16) "October 12, 2005"
Wednesday, June 1, 2011 8
12. Dude, where is my code?
PHP does a lot of magic to resolve partial file
paths for include/require. Now you can too.
stream_resolve_include_path("PEAR.php");
/usr/share/php/PEAR.php
Wednesday, June 1, 2011 9
13. session ini magic
• Improve randomness of session id via the use of /
dev/urandom
session.entropy_file = /dev/urandom
session.entropy_length = 32
• Secure your session cookies from JavaScript
session.use_only_cookies = 1
session.cookie_httponly = 1
Wednesday, June 1, 2011 10
14. mail logging
Want to know what scripts are sending out e-mail?
Well, now you can!
;; This will log every mail() call
mail.log = /path/to/file
mail() on [/tmp/script.php:2]: To: ilia@ilia.ws -- Headers:
;; Adds X-PHP-Originating-Script header
;; Contains UID & filename of the script
mail.add_x_header = On
X-PHP-Originating-Script: 1000:script.php
Wednesday, June 1, 2011 11
15. Better Hashing
A built-in PHP mechanism for generating HMAC
(Hash-based Message Authentication Code)
secured hashes for many algorithms
// 8b266369505f0c90bf193c856aa8f49dc87a759088fd31f28217e4db42a5ac4c
echo hash_hmac('sha256', 'l337PwD', 'secretkey') , "n";
// d82bba393cb2f5e38a4021efc30d43883b1e0a40e30d8ed1c89e7ec263023ec0
echo hash_hmac_file('sha256', __FILE__, 'secretkey') , "n";
Wednesday, June 1, 2011 12
16. SPL FS Tricks
Simple recursive directory traversal
foreach (
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator('.')
) as $file)
{
echo $file , "n";
}
Wednesday, June 1, 2011 13
17. SPL FS Tricks
Recursive directory traversal with pattern matching
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator('.')
);
$regx = new RegexIterator(
$it,
'/^.*.php$/i', // returns only matching text
RecursiveRegexIterator::GET_MATCH
);
foreach ($regx as $file) {
echo $file[0] , "n";
}
Wednesday, June 1, 2011 14
18. igbinary
• The awesome PHP Serializer you should use!
• Faster
• More Compact
;; Load igbinary extension
extension=igbinary.so
;; Use igbinary as session serializer
session.serialize_handler=igbinary
http://github.com/igbinary
Wednesday, June 1, 2011 15
19. igbinary
Provides functions you can use for non-session data.
ini_set("igbinary.compact_strings", 0);
igbinary_serialize($_SERVER);
ini_set("igbinary.compact_strings", 1);
igbinary_serialize($_SERVER);
// Un-serialize
igbinary_unserialize($x);
Wednesday, June 1, 2011 16
21. FileInfo
• A reliable mechanism for identifying files
‣ Not dependant on file extension
‣ Can provide mime types
‣ Identifies hundreds of file types
Wednesday, June 1, 2011 18
23. StatGrab
• An system informatics extension that
provides information on:
Memory Running Processed System Load
CPU Swap Utilization System Info
Network User Statistics etc...
http://pecl.php.net/statgrab
Wednesday, June 1, 2011 20
32. MailParse
• A very good mechanism for parsing
complex e-mails
• Does a lot of the legwork for you
• Stable & Fast
http://pecl.php.net/mailparse
Wednesday, June 1, 2011 29
33. MailParse
$msg = file_get_contents("php://stdin");
$mime = mailparse_msg_create();
if (!mailparse_msg_parse($mime, $msg)) {
exit("could not parse email!n");
}
if (!($msg_info = mailparse_msg_get_part_data($mime))) {
exit("could not get message info!n");
} // $msg_info['headers'] is the headers associated array
$structure = mailparse_msg_get_structure($mime);
Wednesday, June 1, 2011 30
34. $msg_info[‘headers’]
Array
(
[return-path] => <apache@sender.com>
[envelope-to] => ilia@ilia.ws
[delivery-date] => Mon, 20 Jul 2009 13:15:32 -0400
[received] => Array
(
[0] => from attendant.sender.net ([208.68.18.236] helo=hydrogen.sender.net) by ilia.ws with
esmtp (Exim 4.69) (envelope-from <apache@sender.com>) id 1MSwSa-0006lY-4O for ilia@ilia.ws; Mon,
20 Jul 2009 13:15:32 -0400
[1] => from hydrogen.sender.net (hydrogen.sender.net [127.0.0.1]) by hydrogen.sender.net
(8.13.8/8.13.8) with ESMTP id n6KHFQ1g022841 for <ilia@ilia.ws>; Mon, 20 Jul 2009 11:15:26 -0600
[2] => (from apache@localhost) by hydrogen.sender.net (8.13.8/8.13.8/Submit) id
n6KHFQR4022840; Mon, 20 Jul 2009 11:15:26 -0600
)
[date] => Mon, 20 Jul 2009 11:15:26 -0600
[message-id] => <200907201715.n6KHFQR4022840@hydrogen.sender.net>
[to] => ilia@ilia.ws
[subject] => 2027197
[from] => from@sender.com
[mime-version] => 1.0
[content-type] => multipart/mixed; boundary="______b7bfcc06f00337de46276f92b6833d5c++++++"
)
Wednesday, June 1, 2011 31
35. MailParse
// go through components of the e-mail
$body = ''; $atms = array();
foreach ($structure as $element) {
$part_mime = mailparse_msg_get_part($mime, $element);
$part = mailparse_msg_get_part_data($part_mime);
if (!$part) continue;
$part_content = substr($msg,
$part['starting-pos-body'],
$part['ending-pos-body'] -
$part['starting-pos-body']);
Wednesday, June 1, 2011 32
39. PHP-Excel
• An interface to LibXL library
• Allows generation of Excel Biff8 & XML
documents
• Can parse Excel Biff (5-8) and XML
documents
• Wickedly FAST! 200k rows in < 1 second
https://github.com/iliaal/php_excel
Wednesday, June 1, 2011 36
42. xhprof
• Light weight PHP profiler designed for in
production use.
• Aggregate run data
• Web interface
• In-Production “sampling” mode
http://pecl.php.net/package/xhprof
http://github.com/preinheimer/xhprof
Wednesday, June 1, 2011 39
43. Profiling
;; Pre-pended to every PHP script (init)
auto_prepend_file = /xhprof/external/header.php
include_once __DIR__ . '/xhprof_lib/config.php');
include_once __DIR__ . '/xhprof_lib/utils/xhprof_lib.php';
include_once __DIR__ . '/xhprof_lib/utils/xhprof_runs.php';
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
;; Appended to every PHP script (store)
auto_append_file = /xhprof/external/footer.php
$xhprof_data = xhprof_disable();
$xhprof_runs = new XHProfRuns_Default();
$xhprof_runs->save_run($xhprof_data, 'AppName', null, $_xhprof);
Wednesday, June 1, 2011 40