Valeriy Rabievskiy leads a web studio called stfalcon.com and is an active open source developer. Doctrine 2 is separated into common, DBAL, ORM, and migrations libraries. Entities are lightweight PHP classes that store data in object properties without needing to extend a base class. The EntityManager acts as the central access point for ORM functions like updating entities and accessing repositories. ZF2 integrates with Doctrine 2 through autoloading. The console provides commands for tasks like validating the schema, generating proxies, and running migrations to update the database schema.
The document discusses Magento's rendering system and how it generates output for the customer. The main goals of rendering are to generate headers and response body. It describes how controllers dispatch requests and set the response body. Layout, blocks and templates are loaded to generate the final HTML output. Key aspects covered include loading and building the layout, finding template files, and directly including templates to render block output.
PHP Data Objects (PDO) provides a clear, simple (but powerful), unified API for working with all our favorite databases. Features include prepared statements with bound parameters (for all databases, even those that don¡¯t natively support them), transactions, cursors, LOBs, and flexible error handling.
Corephpcomponentpresentation 1211425966721657-8PrinceGuru MS
?
The document discusses various components and techniques for developing extensions for Joomla! 1.5, including using libraries, retrieving data from requests, working with databases, routing, errors, security, and redirects. It also mentions tools like Aptana and J!Dump that can aid development and covers methods for querying, loading, and receiving results from databases.
PDO provides a consistent interface for accessing databases in PHP. It allows for data access abstraction by providing a common API for different database drivers like MySQL, PostgreSQL, SQL Server and SQLite. Using PDO avoids vendor lock-in and makes it easier to change database backends without refactoring code. The document provides examples of connecting and querying databases using different database extensions like mysql, mysqli and sqlsrv and illustrates how PDO offers a consistent alternative.
This document discusses agile database access with CakePHP 3. It covers types of object-relational mappers (ORMs), setting up associations between tables, performing simple and complex queries, formatting and debugging queries, modifying JSON output, using value objects, and more advanced topics like custom serialization and associations between databases. The goal is to provide an ORM that is quick, flexible, and easy to work with for both simple and complex database needs.
The document contains code for unit testing a PHP MVC application using PHPUnit. It includes:
- Code for the Todo model and its tests using PHPUnit assertions.
- Configuration for PHPUnit to run tests for the application and library.
- Tests for the IndexController using a Test_ControllerTestCase class with helper methods.
- Code for Request, Response and View classes to mock the MVC framework.
- A test to interact with the application interface using Selenium.
The document shows the project structure for an MVC application and library with tests. It demonstrates how to test models, controllers and the user interface using test doubles, assertions and helper methods in PHPUnit.
PDO (PHP Data Objects) provides a common interface for accessing databases in PHP. It uses prepared statements to separate SQL structures from user-supplied input, improving security and performance. PDO supports databases like MySQL, PostgreSQL, SQLite, and Oracle. It offers flexible fetching of query results as arrays, objects, or callbacks. PDO also includes features like transactions, metadata retrieval, and error handling via exceptions.
The document discusses the architecture of a shopping cart system and how to make it easily testable and extensible. It recommends separating the core logic from session and database handling, and making frequently changing features into plugins. It also suggests simplifying the structure for easier testing by using storage instead of sessions, and DAO instead of databases during tests. The storage abstraction layer is implemented to operate on different mediums like arrays or sessions.
Internationalizing CakePHP ApplicationsPierre MARTIN
?
The document discusses internationalization in CakePHP, including:
- Using methods like __() and __n() to translate text strings, and Configure::write() to set the application language.
- The Translate behavior, which allows translating database records into multiple languages and automatically filtering by the current language.
- Generating translation files using the i18n extractor, editing them with POEDIT, and caching translated elements.
The document discusses the future of HTTP support in CakePHP. It outlines plans to adopt the PSR-7 standard for HTTP message interfaces. PSR-7 support will be introduced as an opt-in middleware stack in version 3.3, and will become the default stack in 3.4. The new stack will provide improved request and response objects, and support for middleware. The transition is designed to be backwards compatible, with deprecation warnings before removing legacy features in CakePHP 4.0.
This document discusses using the Drupal database API to interact with the database in Drupal. It covers the basics of db_query and dynamic queries using db_select. It discusses how to add conditions, joins, sorting, and other clauses to dynamic queries. It also covers how to work with result sets and how to perform inserts, updates, and deletes using the API. Finally, it discusses when to use the database API versus views and provides a case study comparing the two approaches.
This document provides PHP tips and tricks summarized in 3 sentences:
It discusses various PHP functions for working with arrays, URLs, variables, objects, output buffering, caching, error handling, and debugging - including array_rand(), parse_url(), compact(), extract(), variable variables, output buffering, auto_prepend caching, and get_debug_backtrace(). The document is presented by Damien S¨¦guy and provides code examples to demonstrate various PHP language features and best practices.
The document discusses using the Lithium PHP framework to build a photo blog application. It provides examples of defining a Photos model to interact with photo data, building views to display and edit photos, implementing a PhotosController to handle requests and define actions, and setting routes. The model saves photo data and tags to the database. Views are used to display photo details, edit forms, and render tags as links. The controller handles index, view, add, edit and nearby location based actions. Routes are also defined, including one to directly serve photo image files.
This document contains a summary of jQuery secrets presented by Bastian Feder. It discusses various techniques including saving and removing state from DOM elements using jQuery.data() and jQuery.removeData(), extending jQuery functionality through plugins, and customizing AJAX requests and event handling. The presentation provides code examples for working with jQuery's data storage methods, namespaces, promises/deferreds, global AJAX settings, and extending jQuery.
A lot of people using PHPunit for testing their source code. While I was observing my team I recognized most of them are only using the standard assertions like 'assertEquals()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis and it digs deep into uncommon features of PHPUnit.
This document provides an overview of the Field API in Drupal. It discusses key terminology like entities, field types, and bundles. It also demonstrates how to implement a field formatter and widget using hooks. Finally, it covers language handling and retrieving field data via the Entity API. The presentation aims to provide practical tips and examples for working with fields and entities in Drupal.
CakePHP 3 comes with a new ORM. This talk starts with a short history of how this library came to be and then walk through a series of examples from beginner to advanced for using the Querying features of the ORM.
This document discusses migrating from Drupal 6 and 7 to Drupal 8. It provides an overview of the Migrate module, which allows importing content and configuration from other Drupal versions or external systems. Key aspects covered include the source and destination plugins, processing pipelines, and the overall migration workflow of mapping, processing and importing data. Examples of how to configure and execute migrations using Drush or custom code are also presented.
The document discusses the Render API in Drupal 7 as a successor to the Form API and theme system in Drupal 6. It describes three ways to build the presentation layer: the noob way using inline PHP, the Drupal 6 way using theme functions, and the Drupal 7 way using renderable arrays. Renderable arrays allow content to be altered in a common way and provide advantages like transparent caching and attaching resources. Key aspects of the Render API covered include hook_theme, the renderable array structure, content altering functions, and performance/caching techniques.
PHP 5.3 and Lithium: the most rad php frameworkG Woo
?
Presentation given to the Orange County PHP meetup on Feb 24 2010. The presentation covers the new features in php 5.3 and goes on to show how they are used in Lithium, the most rad php framework.
This document summarizes jQuery secrets presented by Bastian Feder. It discusses utilities like jQuery.data() and jQuery.removeData() for saving and removing state on DOM elements. It also covers AJAX settings, events, extending jQuery, and jQuery plugins. The presentation provides code examples for working with data, events, namespaces, AJAX, and extending jQuery functionality.
This document discusses changes to the Field API from Drupal 7 to Drupal 8. In Drupal 8, fields are classes that implement interfaces and can be base fields or configurable fields. The Field API was rewritten using the Entity API and Typed Data API, treating fields as entities. Fields now have formatters and widgets that are defined as plugins. Validators are implemented using the new Validation API. Accessing field data is abstracted through magic methods. The document provides examples of defining formatters and widgets as plugins in Drupal 8.
The document discusses dependency injection containers and configuration in frameworks. It provides examples of configuring services like mail transport and mailers using different approaches like procedural code, object-oriented code, and XML configuration. It also discusses managing configuration for different environments and making components more flexible through inheritance and customization.
This document discusses dependency injection with PHP and PHP 5.3. It provides an example of managing user preferences with a User object that depends on a SessionStorage object for persistence between requests. The document argues that directly instantiating dependencies within classes leads to rigid code that is hard to customize or test. Instead, it advocates injecting dependencies through a class's constructor to make the code more flexible and decoupled. It then introduces a simple dependency injection container for PHP 5.3 that can manage object instantiation and dependencies.
This document provides an overview of the current state of PHP. It discusses PHP's history from version 3 through the current version 5.3, highlighting improvements like objects, namespaces, and closures. It also mentions some challenges with PHP like messy projects and too many frameworks. The document recommends using best practices like testing and design patterns. It discusses alternatives like JavaScript for frontend work. Overall it suggests PHP is a mature and elegant option for building businesses but also considers other technologies may be better fits depending on requirements. The author is available to answer questions.
With over 3400 available built-in function, PHP offers a tremendously rich environment. Yet, some of these functions are still unknown to most programmers. During this session, Damien Seguy will highlight a number of functions that are rarely used in PHP, but are nonetheless useful and available within standard distributions.
Internationalizing CakePHP ApplicationsPierre MARTIN
?
The document discusses internationalization in CakePHP, including:
- Using methods like __() and __n() to translate text strings, and Configure::write() to set the application language.
- The Translate behavior, which allows translating database records into multiple languages and automatically filtering by the current language.
- Generating translation files using the i18n extractor, editing them with POEDIT, and caching translated elements.
The document discusses the future of HTTP support in CakePHP. It outlines plans to adopt the PSR-7 standard for HTTP message interfaces. PSR-7 support will be introduced as an opt-in middleware stack in version 3.3, and will become the default stack in 3.4. The new stack will provide improved request and response objects, and support for middleware. The transition is designed to be backwards compatible, with deprecation warnings before removing legacy features in CakePHP 4.0.
This document discusses using the Drupal database API to interact with the database in Drupal. It covers the basics of db_query and dynamic queries using db_select. It discusses how to add conditions, joins, sorting, and other clauses to dynamic queries. It also covers how to work with result sets and how to perform inserts, updates, and deletes using the API. Finally, it discusses when to use the database API versus views and provides a case study comparing the two approaches.
This document provides PHP tips and tricks summarized in 3 sentences:
It discusses various PHP functions for working with arrays, URLs, variables, objects, output buffering, caching, error handling, and debugging - including array_rand(), parse_url(), compact(), extract(), variable variables, output buffering, auto_prepend caching, and get_debug_backtrace(). The document is presented by Damien S¨¦guy and provides code examples to demonstrate various PHP language features and best practices.
The document discusses using the Lithium PHP framework to build a photo blog application. It provides examples of defining a Photos model to interact with photo data, building views to display and edit photos, implementing a PhotosController to handle requests and define actions, and setting routes. The model saves photo data and tags to the database. Views are used to display photo details, edit forms, and render tags as links. The controller handles index, view, add, edit and nearby location based actions. Routes are also defined, including one to directly serve photo image files.
This document contains a summary of jQuery secrets presented by Bastian Feder. It discusses various techniques including saving and removing state from DOM elements using jQuery.data() and jQuery.removeData(), extending jQuery functionality through plugins, and customizing AJAX requests and event handling. The presentation provides code examples for working with jQuery's data storage methods, namespaces, promises/deferreds, global AJAX settings, and extending jQuery.
A lot of people using PHPunit for testing their source code. While I was observing my team I recognized most of them are only using the standard assertions like 'assertEquals()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis and it digs deep into uncommon features of PHPUnit.
This document provides an overview of the Field API in Drupal. It discusses key terminology like entities, field types, and bundles. It also demonstrates how to implement a field formatter and widget using hooks. Finally, it covers language handling and retrieving field data via the Entity API. The presentation aims to provide practical tips and examples for working with fields and entities in Drupal.
CakePHP 3 comes with a new ORM. This talk starts with a short history of how this library came to be and then walk through a series of examples from beginner to advanced for using the Querying features of the ORM.
This document discusses migrating from Drupal 6 and 7 to Drupal 8. It provides an overview of the Migrate module, which allows importing content and configuration from other Drupal versions or external systems. Key aspects covered include the source and destination plugins, processing pipelines, and the overall migration workflow of mapping, processing and importing data. Examples of how to configure and execute migrations using Drush or custom code are also presented.
The document discusses the Render API in Drupal 7 as a successor to the Form API and theme system in Drupal 6. It describes three ways to build the presentation layer: the noob way using inline PHP, the Drupal 6 way using theme functions, and the Drupal 7 way using renderable arrays. Renderable arrays allow content to be altered in a common way and provide advantages like transparent caching and attaching resources. Key aspects of the Render API covered include hook_theme, the renderable array structure, content altering functions, and performance/caching techniques.
PHP 5.3 and Lithium: the most rad php frameworkG Woo
?
Presentation given to the Orange County PHP meetup on Feb 24 2010. The presentation covers the new features in php 5.3 and goes on to show how they are used in Lithium, the most rad php framework.
This document summarizes jQuery secrets presented by Bastian Feder. It discusses utilities like jQuery.data() and jQuery.removeData() for saving and removing state on DOM elements. It also covers AJAX settings, events, extending jQuery, and jQuery plugins. The presentation provides code examples for working with data, events, namespaces, AJAX, and extending jQuery functionality.
This document discusses changes to the Field API from Drupal 7 to Drupal 8. In Drupal 8, fields are classes that implement interfaces and can be base fields or configurable fields. The Field API was rewritten using the Entity API and Typed Data API, treating fields as entities. Fields now have formatters and widgets that are defined as plugins. Validators are implemented using the new Validation API. Accessing field data is abstracted through magic methods. The document provides examples of defining formatters and widgets as plugins in Drupal 8.
The document discusses dependency injection containers and configuration in frameworks. It provides examples of configuring services like mail transport and mailers using different approaches like procedural code, object-oriented code, and XML configuration. It also discusses managing configuration for different environments and making components more flexible through inheritance and customization.
This document discusses dependency injection with PHP and PHP 5.3. It provides an example of managing user preferences with a User object that depends on a SessionStorage object for persistence between requests. The document argues that directly instantiating dependencies within classes leads to rigid code that is hard to customize or test. Instead, it advocates injecting dependencies through a class's constructor to make the code more flexible and decoupled. It then introduces a simple dependency injection container for PHP 5.3 that can manage object instantiation and dependencies.
This document provides an overview of the current state of PHP. It discusses PHP's history from version 3 through the current version 5.3, highlighting improvements like objects, namespaces, and closures. It also mentions some challenges with PHP like messy projects and too many frameworks. The document recommends using best practices like testing and design patterns. It discusses alternatives like JavaScript for frontend work. Overall it suggests PHP is a mature and elegant option for building businesses but also considers other technologies may be better fits depending on requirements. The author is available to answer questions.
With over 3400 available built-in function, PHP offers a tremendously rich environment. Yet, some of these functions are still unknown to most programmers. During this session, Damien Seguy will highlight a number of functions that are rarely used in PHP, but are nonetheless useful and available within standard distributions.
The document discusses Magento's product management style and unified process. It summarizes that Magento releases new features about every 3 months with a team of 30+ people developing 3-4 features per release. The development process involves creating small cross-functional teams of 2-4 people to work on each feature throughout its lifecycle. An architectural council of experienced developers provides guidance and training. Time management follows critical path methodology and Gantt charts.
Doctrine MongoDB ODM is an object document mapper for PHP that provides tools for managing object persistence with MongoDB. It allows developers to work with MongoDB documents as objects and provides a query API and change tracking functionality to make common operations like inserting, updating, and deleting documents straightforward. Doctrine abstracts away the low-level MongoDB driver to allow developers to work with documents and references between documents using familiar object-oriented patterns.
The document provides an overview of using the Drupal database API for interacting with the Drupal database. It covers basics of db_query and dynamic queries using db_select. Key points include using placeholders in queries, working with result sets, and more advanced topics like joins, sorting, conditional statements, and query tagging. The document suggests considering the database API as an alternative to Views when custom queries or aggregated data are needed that may require complex Views configuration.
Go beyond the documentation and explore some of what's possible if you stretch symfony to its limits. We will look at a number of aspects of symfony 1.4 and Doctrine 1.2 and tease out some powerful functionality you may not have expected to find, but will doubtless be able to use. Topics covered will include routing, forms, the config cache and record listeners. If you're comfortable in symfony and wondering what's next, this session is for you.
The document describes a web application for managing flower data using CodeIgniter. It includes configuration files that set up the database connection and load necessary libraries. The FlowerController handles requests and loads corresponding views for listing, viewing, inserting, editing, and updating flowers. The FlowerModel interacts with the database to get flower data by ID or all flowers. Views display and allow editing the flower data.
This document summarizes changes to the Drupal 7 API, including improvements to the database, translation, rendering, queue, and file APIs. Key changes include an object-oriented database API, support for localization servers, storing page content as render arrays, adding producer/worker queues to offload long tasks from cron, and a stream-based file API. Modules can now more easily alter queries and page output, and additional queue and file stream types can be defined.
The document provides an overview of the Doctrine NoSQL project. It discusses how Doctrine provides object document mappers for NoSQL databases like MongoDB, CouchDB, and PHPCR to allow working with documents as objects. It describes the common persistence interfaces, mapping capabilities like associations and embedded objects, and how basic CRUD operations work. It also highlights benefits of NoSQL databases like schemaless storage and how Doctrine supports features of specific databases like views, attachments, and geospatial queries.
Rich domain model with symfony 2.5 and doctrine 2.5Leonardo Proietti
?
This document summarizes a presentation on building a rich domain model with Symfony2 and Doctrine2. It discusses modeling the domain by focusing on the problem space rather than the solution space. It emphasizes making the domain model ubiquitous by using a common language throughout the code and contexts. The presentation also covers using entities as both domain objects and persistence model objects, validating inputs and protecting invariants, and taking an iterative test-driven approach to developing the domain model.
The document provides information about new features and integration of Symfony and Doctrine. It discusses updates to the DoctrineBundle and new bundles for MongoDB integration and database migrations. It also covers using the Doctrine database abstraction layer independently and the object relational mapper, including entity management, querying, and schema management.
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.
The document discusses changes and new features in Drupal 7 related to APIs, database queries, and file handling. Key points include:
- Database queries are now built using query objects that support features like placeholders, joins, conditions, and multiple inserts.
- Files are now first-class entities with a files table, managed and unmanaged file types, and stream wrappers for various locations.
- Functions like db_query, db_insert and file_load were updated, and new APIs allow altering queries and copying/deleting files.
This document discusses using the Doctrine ORM framework to improve object mapping in Joomla. It describes how Doctrine allows mapping between objects and database tables through associations like one-to-one, one-to-many, and many-to-many relationships. Using Doctrine's mapping features could help address Joomla's limitations with hierarchies, nested objects, and separating data structure from content models. The Jooctrine package provides an easy way to use Doctrine in Joomla extensions by handling configuration, models, and table prefixes. While Doctrine improves object mapping, fully replacing Joomla's core functionality could break many aspects that rely on its current design.
The document discusses several software design patterns and concepts used in Zend Framework 3 including singleton, dependency injection, factory, data mapper, caching, and logging. It provides definitions and examples of how each pattern addresses issues like high cohesion, loose coupling, and testability. Key benefits are outlined such as reusability, reduced dependencies, and more readable code.
The document discusses dependency injection in PHP. It begins by defining dependency injection as giving an object its instance variables. It then discusses why dependency injection is used, including that it makes code more maintainable, extensible, flexible, configurable, testable, reusable and interoperable. The document provides a PHP example to demonstrate dependency injection and discusses additional options like using interfaces and type hinting. It explains how dependency injection allows switching between different database implementations easily and provides examples for MySQL, MongoDB and SQLite. Finally, it discusses using a DI container to further simplify managing object dependencies.
You¡¯ve seen Kris¡¯ open source libraries, but how does he tackle coding out an application? Walk through green fields with a Symfony expert as he takes his latest ¡°next big thing¡± idea from the first line of code to a functional prototype. Learn design patterns and principles to guide your way in organizing your own code and take home some practical examples to kickstart your next project.
The document summarizes differences between MySQL and MongoDB data types and operations. MongoDB uses BSON for data types rather than separate numeric, text and blob types. It supports embedded documents and arrays. Unlike MySQL, MongoDB does not have tables or rows, but collections and documents. Operations like insert, update, find, sort and index are discussed as alternatives to SQL equivalents.
This document discusses Wade Arnold's experience with PHP and Zend Framework. It provides an overview of Wade's background working on Zend Amf and other PHP projects. It also includes examples of file structures, models, and services that demonstrate how to build a PHP application that integrates with Flash using Zend Amf. The document advocates for using standards like Zend Framework to build robust PHP applications and services.
Eloquent ¨¨ uno strumento potentissimo: permette di velocizzare, e di molto, lo sviluppo di applicazioni web offrendoti un¡¯interfaccia molto chiara e intuitiva. Per la prototipazione rapida ¨¨ il massimo. Tuttavia, non appena l¡¯applicazione cresce di dimensione, la situazione rischia di esploderci in mano in quanto Eloquent soffre di tutti i limiti di un Active Record. Un¡¯alternativa a questo pattern ¨¨ il Data Mapper, implementato in maniera eccellente da Doctrine. In questo talk vedremo quindi come integrare Doctrine all'interno di Laravel e verr¨¤ dato qualche spunto su come strutturare un¡¯architettura molto pi¨´ solida.
This document summarizes several key classes in CodeIgniter including the Database, Calendar, Config, Email, File Upload, and Form Validation classes. It provides examples of how to use each class, explaining their main functions and capabilities. The Database class allows querying, selecting, inserting, updating, and deleting of data. The Calendar class generates calendars from templates. The Config class retrieves configuration values. The Email class handles sending emails with attachments. The File Upload class manages uploading files. And the Form Validation class validates form data and displays errors.
6. §±§â§Ú§Þ§Ö§â §Þ§à§Õ§Ö§Ý§Ú
namespace Entities;
class User
{
private $id;
private $name;
public function getId() { return $this->id; }
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}
namespace Entities;
class User
{
private $id;
private $name;
public function getId() { return $this->id; }
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}
19. Console: ORM
$ ./doctrine orm:ensure-production-settings
Proxy Classes are always regenerating.
$ ./doctrine orm:ensure-production-settings
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost'
$ ./doctrine orm:ensure-production-settings
Environment is correctly configured for production.
$ ./doctrine orm:ensure-production-settings
Proxy Classes are always regenerating.
$ ./doctrine orm:ensure-production-settings
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost'
$ ./doctrine orm:ensure-production-settings
Environment is correctly configured for production.
§±§â§à§Ó§Ö§â§Ü§Ñ §Ü§à§â§â§Ö§Ü§ä§ß§à§ã§ä§Ú §ß§Ñ§ã§ä§â§à§Ö§Ü
§Õ§Ý§ñ production
20. Console: ORM
§£§Ñ§Ý§Ú§Õ§Ñ§è§Ú§ñ §Þ§à§Õ§Ö§Ý§Ú
$ ./doctrine orm:validate-schema
[Mapping] FAIL - The entity-class 'EntitiesAddress' mapping is invalid:
* The field EntitiesAddress#user is on the inverse side of a
bi-directional Relationship, but the specified mappedBy association
on the target-entity EntitiesUser#address does not contain the
required 'inversedBy' attribute.
[Database] FAIL - The database schema is not in sync with the
current mapping file.
$ ./doctrine orm:validate-schema
[Mapping] FAIL - The entity-class 'EntitiesAddress' mapping is invalid:
* The field EntitiesAddress#user is on the inverse side of a
bi-directional Relationship, but the specified mappedBy association
on the target-entity EntitiesUser#address does not contain the
required 'inversedBy' attribute.
[Database] FAIL - The database schema is not in sync with the
current mapping file.
24. Migrations
§¶§Ú§Ü§ã§Ú§â§å§Ö§Þ §Ú§Ù§Þ§Ö§ß§Ö§ß§Ú§ñ §Ó §Þ§Ú§Ô§â§Ñ§è§Ú§Ú
$ ./doctrine migrations:diff
Generated new migration class
to "path/to/migrations/Version20101124201328.php" from schema differences.
$ ./doctrine migrations:diff
Generated new migration class
to "path/to/migrations/Version20101124201328.php" from schema differences.
namespace DoctrineMigrations;
class Version20101124201328 extends AbstractMigration
{
public function up(Schema $schema) {
$this->_addSql('CREATE TABLE users (...) ENGINE = InnoDB');
}
public function down(Schema $schema) {
$this->_addSql('DROP TABLE users');
}
}
namespace DoctrineMigrations;
class Version20101124201328 extends AbstractMigration
{
public function up(Schema $schema) {
$this->_addSql('CREATE TABLE users (...) ENGINE = InnoDB');
}
public function down(Schema $schema) {
$this->_addSql('DROP TABLE users');
}
}
25. Migrations
§¯§Ñ§Ü§Ñ§ä§í§Ó§Ñ§ß§Ú§Ö §Þ§Ú§Ô§â§Ñ§è§Ú§Ú
$ ./doctrine migrations:migrate --dry-run
Executing dry run of migration up to 20101124201328 from 0
++ migrating 20101124201328
-> CREATE TABLE users ( ... ) ENGINE = InnoDB
++ migrated (0.01s)
------------------------
++ finished in 0.01
++ 1 migrations executed
++ 1 sql queries
$ ./doctrine migrations:migrate --dry-run
Executing dry run of migration up to 20101124201328 from 0
++ migrating 20101124201328
-> CREATE TABLE users ( ... ) ENGINE = InnoDB
++ migrated (0.01s)
------------------------
++ finished in 0.01
++ 1 migrations executed
++ 1 sql queries
26. Migrations
§¤§Ö§ß§Ö§â§Ú§â§å§Ö§Þ §Ù§Ñ§Ô§à§ä§à§Ó§Ü§å §Þ§Ú§Ô§â§Ñ§è§Ú§Ú
$ ./doctrine migrations:generate --editor-cmd=netbeans
Generated new migration class to "path/to/migrations/Version20101124201328.php"
$ ./doctrine migrations:generate --editor-cmd=netbeans
Generated new migration class to "path/to/migrations/Version20101124201328.php"
namespace DoctrineMigrations;
class Version20101124201328 extends AbstractMigration
{
public function up(Schema $schema) {
// $this->_addSql('CREATE TABLE users (...) ENGINE = InnoDB');
$table = $schema->createTable('users');
$table->addColumn('username', 'string');
}
public function down(Schema $schema) {
$schema->dropTable('users');
}
}
namespace DoctrineMigrations;
class Version20101124201328 extends AbstractMigration
{
public function up(Schema $schema) {
// $this->_addSql('CREATE TABLE users (...) ENGINE = InnoDB');
$table = $schema->createTable('users');
$table->addColumn('username', 'string');
}
public function down(Schema $schema) {
$schema->dropTable('users');
}
}