[{{mminutes}}:{{sseconds}}] X
Пользователь приглашает вас присоединиться к открытой игре игре с друзьями .
Expert PHP
(0)       Используют 11 человек

Комментарии

Ни одного комментария.
Написать тут
Описание:
PHP AND MYSQL HAVE BEEN USED FOR YEARS to power some of the most popular websites and open source applications anywhere.
Автор:
jek04
Создан:
28 июня 2018 в 12:26
Публичный:
Да
Тип словаря:
Книга
Последовательные отрывки из загруженного файла.
Информация:
PHP AND MYSQL HAVE BEEN USED FOR YEARS to power some of the most popular websites and
open source applications anywhere. It’s no secret that the Web has evolved. Modern web sites are
expected to be dynamic and the user count for popular sites is now measured in the millions.
This book examines some of the technologies and techniques needed to make robust and scalable
applications perform in today’s high-demand world. Early chapters focus on essential concepts. For
example:
➤ Object Oriented Programming
➤ Design Patterns
➤ Advanced MySQL queries
Содержание:
12 отрывков, 5356 символов
1 CHAPTER 1 TECHNIQUES EVERY EXPERT PROGRAMMER NEEDS TO KNOW
WHATвS IN THIS CHAPTER?
- Understanding Object-oriented fundamentals in PHP
- Understanding INNER and OUTER JOINs
- Other JOIN syntax you should know
- Using MySQL Unions
- Using GROUP BY in MySQL queries
- Implementing MySQL Logical Operations and fl ow control
- Maintaining MySQL relational integrity
- Using subqueries in MySQL
- Utilizing advanced PHP regular expressions.
2 This chapter covers the techniques that you, the profi cient PHP and MySQL developer, should know and use before you tackle more advanced domain features in PHP and MySQL. The chapter starts with an in-depth overview of object-oriented programming techniques in PHP and object-oriented design patterns. As a PHP developer, you then become familiar with a number of core MySQL requirements for retrieving data including the different types of joins, UNION , GROUP BY , and subqueries syntax.
3 This chapter also details the logic operators and fl ow control and techniques for maintaining relational integrity in MySQL. The chapter con- cludes with an in-depth review of advanced regular expressions in both PHP and MySQL.
OBJECT-ORIENTED PHP
Object-orientation has become a key concept behind proper PHP software design. This book follows the idea that in properly designed software, all business logic (the rules that drive how an application behaves) should be object oriented.
4 The only exception is when small scripts act as a view or a way to display data returned from other objects. Taking this approach solves a few problems because it:
- Makes it easy to extend the functionality of existing code.
- Allows for type hinting, which gives greater control over what variables are passed into functions.
- Allows for established design patterns to be used to solve common software design problems and makes debugging much easier.
5 This section covers object-oriented PHP and key design patterns in depth. Later chapters cover even more advanced object-oriented topics.
INSTANTIATION AND POLYMORPHISM
The two key benefi ts of object-oriented programming in PHP are the ability to abstract data into classes and for the application to act on those structures. It is important to understand polymorphism, which is when one object appears and can be used in the same way as another object of a related type.
6 It stands to reason that if B is a descendant of A and a function can accept A as a parameter, it can also accept B. Three classes are used in this chapter while covering polymorphism:
- Node
- BlogEntry
- ForumTopic.
In this application both BlogEntry and ForumTopic are siblings of each other and descendants of Node. This is a good time to become familiar with the example code that comes with the book.
7 The code archive contains a folder for every chapter. Each folder has a .class.php fi le and a .test.php fi le for every class. SQL fi les arenвt used in this section, but when they are, they have a .sql extension. The typical class looks a lot like this:
class ClassNameHere extends AnotherClass {
public function someFunction() {
parent::someFunction();
}
}
The parent keyword is used to directly reference a variable or method in the parent class, bypassing any variables or methods of the same name in the current class.
8 The method is marked as public, which is a familiar concept for object-oriented programming but relatively new to PHP.
Older PHP applications will not defi ne a visibility for the member methods. When the visibility is not defi ned it is assumed to be public. A member variable or method (function inside a class) can have one of three visibilities:
- public indicates that the member is accessible globally across all of PHP.
9 - private indicates that a member can be accessed only from within the class in which it is defined. Private members cannot be overridden in later classes because those classes too do not have access to the member.
- protected indicates that the member can be accessed only by the class in which it is defined and all descending classes.
Additionally, three other keywords can augment private, public, and protected.
10 They are static, abstract, and final:
- static members are not tied to particular instances of a class and can be accessed by any instance. They should be used sparingly but are very useful for shared variables across all instances. The static keyword can also be used inside methods and functions to define a variable that is global to all calls to that function. Both uses are relied upon by later examples in this chapter.
 

Связаться
Выделить
Выделите фрагменты страницы, относящиеся к вашему сообщению
Скрыть сведения
Скрыть всю личную информацию
Отмена