PHP / MySQL applications are compatible to all operating systems, support all the popular databases, 100% remotely configurable, perfect for web programming & provide higher performance and speed.
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.
MySQL is a Relational Database Management System (RDBMS) that uses Structured Query Language (SQL).
PHP is the most popular scripting language for web development. It is free, open source and server-side (the code is executed on the server).
PHP third party tool and plug-in integration such as chat, forum, blog and search engine
Building Lithium Apps (Like a Boss) was a workshop presented on the structure and philosophy of the Lithium framework and its applications, and how best to take advantage of them.
Building Lithium Apps (Like a Boss) was a workshop presented on the structure and philosophy of the Lithium framework and its applications, and how best to take advantage of them.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
Cette conférence présente deux grands motifs de conception : l'observateur et l'injection de dépendance. Ce sujet allie à la fois théorie et pratique. Le composant autonome EventDispatcher de Symfony ainsi que le conteneur d'injection de dépendance Pimple sont mis à l'honneur avec des exemples pratiques d'usage. Ces cas pratiques combinent du code de l'ORM Propel ainsi que le composant autonome Zend\Search\Lucene du Zend Framework 2
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.
Lithium: The Framework for People Who Hate FrameworksNate Abele
This is the presentation was given at ConFoo on March 11th by Nate Abele and Joël Perras, and is an introduction to the architectural problems with other frameworks that Lithium was designed to address, and how it addresses them. It also introduces programming paradigms like functional and aspect-oriented programming which address issues that OOP doesn't account for.
Finally, the talk provides a quick overview of the innovative and unparalleled features that Lithium provides, including the data layer, which supports both relational and non-relational databases.
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPatrick Allaert
We all have certainly learned data structures at school: arrays, lists, sets, stacks, queues (LIFO/FIFO), heaps, associative arrays, trees, ... and what do we mostly use in PHP? The "array"! In most cases, we do everything and anything with it but we stumble upon it when profiling code. During this session, we'll learn again to use the structures appropriately, leaning closer on the way to employ arrays, the SPL and other structures from PHP extensions as well.The impact that PHP 7 should have on data structures will be introduced as well.
Persistence is one of the most important part in a PHP project. Persisting data to a database came with PHP/FI and its MySQL support. From native extensions and PHP4 database abstraction libraries to PDO and modern ORM frameworks, you will (re)discover how persistence has evolved during the last decade. This talk will also introduce the future of data persistence with the growing success of alternative storage engines.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
Cette conférence présente deux grands motifs de conception : l'observateur et l'injection de dépendance. Ce sujet allie à la fois théorie et pratique. Le composant autonome EventDispatcher de Symfony ainsi que le conteneur d'injection de dépendance Pimple sont mis à l'honneur avec des exemples pratiques d'usage. Ces cas pratiques combinent du code de l'ORM Propel ainsi que le composant autonome Zend\Search\Lucene du Zend Framework 2
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.
Lithium: The Framework for People Who Hate FrameworksNate Abele
This is the presentation was given at ConFoo on March 11th by Nate Abele and Joël Perras, and is an introduction to the architectural problems with other frameworks that Lithium was designed to address, and how it addresses them. It also introduces programming paradigms like functional and aspect-oriented programming which address issues that OOP doesn't account for.
Finally, the talk provides a quick overview of the innovative and unparalleled features that Lithium provides, including the data layer, which supports both relational and non-relational databases.
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPatrick Allaert
We all have certainly learned data structures at school: arrays, lists, sets, stacks, queues (LIFO/FIFO), heaps, associative arrays, trees, ... and what do we mostly use in PHP? The "array"! In most cases, we do everything and anything with it but we stumble upon it when profiling code. During this session, we'll learn again to use the structures appropriately, leaning closer on the way to employ arrays, the SPL and other structures from PHP extensions as well.The impact that PHP 7 should have on data structures will be introduced as well.
Persistence is one of the most important part in a PHP project. Persisting data to a database came with PHP/FI and its MySQL support. From native extensions and PHP4 database abstraction libraries to PDO and modern ORM frameworks, you will (re)discover how persistence has evolved during the last decade. This talk will also introduce the future of data persistence with the growing success of alternative storage engines.
PHP is a widely preferred side-server language, which is the key feature for website development. It is free and an open source for the PHP language that could be used for the uplifting of your website and could help to improve your clientele. PHP codes and HTML codes could be combined and could b used for scripting purpose also.
www.northpolewebservice.com
PHP is a widely preferred side-server language, which is the key feature for website development. It is free and an open source for the PHP language that could be used for the uplifting of your website and could help to improve your clientele. PHP codes and HTML codes could be combined and could b used for scripting purpose also.
https://www.northpolewebservice.com/
Custom, in depth 5 day PHP course I put together in 2014. I'm available to deliver this training in person at your offices - contact me at rich@quicloud.com for rate quotes.
Redis is a NoSQL technology that rides a fine line between database and in-memory cache. Redis also offers "remote data structures", which gives it a significant advantage over other in-memory databases. This session will cover several PHP clients for Redis, and how to use them for caching, data modeling and generally improving application throughput.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
3. Introduction to PHP
“PHP is a server-side scripting language designed
specifically for the Web. Within an HTML page, you can
embed PHP code that will be executed each time the page
is visited. Your PHP code is interpreted at the Web server
and generates HTML or other output that the visitor will
see” (“PHP and MySQL Web Development”, Luke Welling
and Laura Thomson, SAMS)
4. PHP History
●
1994: Created by Rasmis Lesdorf, software engineer (part
of Apache Team)
●
1995: Called Personal Home Page Tool, then released as
version 2 with name PHP/FI (Form Interpreter, to analyze
SQL queries)
●
Half 1997: used by 50,000 web sites
●
October 1998: used by 100,000 websites
●
End 1999: used by 1,000,000 websites
5. Alternatives to PHP
●
Practical extraction and Report Language (Perl)
●
Active Server Pages (ASP)
●
Java server pages (JSP)
●
Ruby
6. (Good) Topics about PHP
●
Open-source
●
Easy to use ( C-like and Perl-like syntax)
●
Stable and fast
●
Multiplatform
●
Many databases support
●
Many common built-in libraries
●
Pre-installed in Linux distributions
7. How PHP generates
HTML/JS Web pages
1: Client from browser send HTTP request (with POST/GET
variables)
2: Apache recognizes that a PHP script is requested and sends the
request to PHP module
3: PHP interpreter executes PHP script, collects script output and
sends it back
4: Apache replies to client using the PHP script output as HTML
output
2
Client
Browser
1 PHP
module3
4
Apache
9. Hello World! (web oriented)
<html>
<head>
<title>My personal Hello World! PHP script</title>
</head>
<body>
<?
echo “Hello World!”;
?>
</html>
PHP tag, allow to insert PHP
code. Interpretation by PHP
module will substitute the code
with code output
10. Variables (I)
•
To use or assign variable $ must be present before the name of
the variable
•
The assign operator is '='
•
There is no need to declare the type of the variable
•
the current stored value produces an implicit type-casting of
the variable.
•
A variable can be used before to be assigned
$A = 1;
$B = “2”;
$C = ($A + $B); // Integer sum
$D = $A . $B; // String concatenation
echo $C; // prints 3
echo $D;// prints 12
11. Variables (II)
•
Function isset tests if a variable is assigned or not
$A = 1;
if (isset($A))
print “A isset”
if (!isset($B))
print “B is NOT set”;
•
Using $$
$help = “hiddenVar”;
$$help = “hidden Value”;
echo $$help; // prints hidden Value
$$help = 10;
$help = $$help * $$help;
echo $help; // print 100
12. Strings (I)
•
A string is a sequence of chars
$stringTest = “this is a sequence of chars”;
echo $stringTest[0]; output: t
echo $stringTest; output: this is a sequence of chars
•
A single quoted strings is displayed “as-is”
$age = 37;
$stringTest = 'I am $age years old'; // output: I am $age years old
$stringTest = “I am $age years old”; // output: I am 37 years old
•
Concatenation
$conc = ”is “.”a “.”composed “.”string”;
echo $conc; // output: is a composed string
$newConc = 'Also $conc '.$conc;
echo $newConc; // output: Also $conc is a composed string
13. Strings (II)
•
Explode function
$sequence = “A,B,C,D,E,F,G”;
$elements = explode (“,”,$sequence);
// Now elements is an array with all substrings between “,” char
echo $elemets[0]; // output: A;
echo $elemets[1]; // output: B;
echo $elemets[2]; // output: C;
echo $elemets[3]; // output: D;
echo $elemets[4]; // output: E;
echo $elemets[5]; // output: F;
echo $elemets[6]; // output: G;
14. Arrays (I)
•
Groups a set of variables, every element stored into an array as
an associated key (index to retrieve the element)
$books = array( 0=>”php manual”,1=>”perl manual”,2=>”C manual”);
$books = array( 0=>”php manual”,”perl manual”,”C manual”);
$books = array (“php manual”,”perl manual”,”C manual”);
echo $books[2]; output: C manual
•
Arrays with PHP are associative
$books = array( “php manual”=>1,”perl manual”=>1,”C manual”=>1); // HASH
echo $books[“perl manual”]; output: 1
$books[“lisp manual”] = 1; // Add a new element
15. •
Working on an arrays
$books = array( ”php manual”,”perl manual”,”C manual”);
•
Common loop
for ($i=0; $i < count($books); $i++)
print ($i+1).”-st book of my library: $books[$i]”;
•
each
$books = array( “php manual”=>1,”perl manual”=>2,”C manual”=>3);
while ($item = each( $books )) // Retrieve items one by one
print $item[“value”].”-st book of my library: ”.$item[“key”];
// each retrieve an array of two elements with key and value of current element
•
each and list
while ( list($value,$key) = each( $books ))
print “$value-st book of my library: $key”;
// list collect the two element retrieved by each and store them in two
different // variables
Arrays (II)
16. Arrays (III)
•
Multidimensional arrays
$books = array( array(“title”=>“php manual”,”editor”=>”X”,”author”=>”A”),
array(“title”=>“perl manual”,”editor”=>”Y”,”author”=>”B”),
array(“title=>“C manual”,”editor”=>”Z”,author=>”C”));
•
Common loop
for ($i=0; $i < count($books); $i++ )
print “$i-st book, title: ”.$books[$i][“title”].” author: “.$books[$i][“author”].
“ editor: “.$books[$i][“editor”];
// Add .”n” for text new page or “.<BR>” for HTML new page;
•
Use list and each
for ($i=0; $i < count($books); $i++)
{
print “$i-st book is: “;
while ( list($key,$value) = each( $books[$i] ))
print “$key: $value ”;
print “<BR>”; // or “n”
}
17. Case study (small database I)
•
You need to build one or more web pages to manage your library, but:
– “You have no time or no knoledge on how to plan and design
database”
– or “You have no time or knolwdge on how to install a free
database”
– And “The database to implement is small” (about few
thousands entries, but depends on server configuration)
18. Case study (small database II)
#cat /usr/local/myDatabaseDirectory/library.txt
php manual X A 330
perl manual Y B 540
C manual Z C 480
(fields separated by tabs: 'php manual<tab>X<tab>A', new line at the end of each
entry)
<? // script to show all book in my library
$books = file(“/usr/local/myDatabaseDirectory/library.txt”); // retrieve library “database”
for ($i=0; $i<count($books), $i++ )
$books_array[$i] = explode( “t”, $books[$i]); // Extract elements from line
...
for ($i=0; $i<count($books_array), $i++ )
print “$i-st book, title: ”.$books_array[$i][“title”].” author: “.$books_array[$i][“author”].
“ editor: “.$books_array[$i][“editor”].”<BR>”;
19. Case study
A way to reuse code (I)
Using functions is possible to write more general code, to allow us to reuse
it to add feature:
– For the same project (always try to write reusable code, also you
will work for a short time on a project)
– For new projects
<? // config.php, is a good idea to use configuration files
$tableFiles = array ( “books”=>”/usr/local/myDatabaseDirectory/books.txt”);
$bookTableFields = array (“title”,”author”,”editor”,”pages”);
// future development of the library project (add new tables)
$tableFiles = array ( “users”=>”/usr/local/myDatabaseDirectory/users.txt”);
$userTableFields = array (“code”,“firstName”,”lastName”,”age”,”institute”);
?>
20. Case study
A way to reuse code (II)
<? // script to show all book in my library
$books = file(“/usr/local/myDatabaseDirectory/library.txt”);
// retrieve library “database”
for ($i=0; $i<count($books), $i++ )
$books_array[$i] = explode( “t”, $books[$i]); // Extract elements from line
...
for ($i=0; $i<count($books_array), $i++ )
print “$i-st book, title: ”.$books_array[$i][“title”].” author: “.$books_array[$i]
[“author”].
“ editor: “.$books_array[$i][“editor”].”<BR>”;
21. Functions in details (I)
The syntax to implement a user-defined
function is :
function function_name([parameters-list]opt)
{……implementation code……}
parameters-list is a sequence of variables separated by “,”
• it’s not allowed to overload the name of an existing function;
• Function names aren’t case-sensitive;
• To each parameter can be assigned a default value;
• arguments can be passed by value or by reference
• It’s possible using a variable number of parameters
•
23. Encapsulation
<?
class dayOfWeek {
var $day,$month,$year;
function dayOfWeek($day,$month,$year) {
$this->day = $day;
$this->month = $month;
$this->year = $year;
}
function calculate(){
if ($this->month==1){
$monthTmp=13;
$yearTmp = $this->year - 1;
}
if ($this->month == 2){
$monthTmp = 14;
$yearTmp = $this->year - 1;
}
$val4 = (($month+1)*3)/5;
$val5 = $year/4;
$val6 = $year/100;
$val7 = $year/400;
$val8 = $day+($month*2)+$val4+$val3+$val5-$val6+
$val7+2;
$val9 = $val8/7;
$val0 = $val8-($val9*7);
return $val0;
}
}
// Main
$instance =
new dayOfWeek($_GET[“day”],$_GET[“week”],$_GET[“
month”]);
print “You born on “.$instance->calculate().”n”;
?>
24. Allow the creation of a hierarchy of classes
Inheritance
Class reuseMe {
function
reuseMe(){...}
function
doTask1(){...}
function
doTask2(){...}
function
doTask3(){...}
}
Class extends reuseMe {
function example(){
... // local initializations
// call super constructor
reuseMe::reuseMe();
}
function doTask4(){...}
function doTask5(){...}
function doTask6(){...}
}
25. Polymorphism
Class extends reuseMe {
function example(){
... // local initializations
// call super constructor
reuseMe::reuseMe();
}
function doTask4(){...}
function doTask5(){...}
function doTask6(){...}
function doTask3(){...}
}
class reuseMe {
function reuseMe(){...}
function doTask1()
{...}
function doTask2()
{...}
function doTask3()
{...}
}
A member function can override superclass
implementation. Allow each subclass to
reimplement a common interfaces.
26. Multiple Inheritance not actually supported by
PHP
class extends reuseMe1,reuseMe2 {...}
class reuseMe1 {
function reuseMe1(){...}
function doTask1(){...}
function doTask2(){...}
function doTask3(){...}
}
class reuseMe2 {
function reuseMe2(){...}
function doTask3(){...}
function doTask4(){...}
function doTask5(){...}
}