Drupal development

727 views
664 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
727
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Drupal development

  1. 1. How to? Drupal developer toolkit <ul>Drupal Camp Donetsk November 2011 Dennis Povshedny </ul>
  2. 2. Drupal developer toolkit <ul>Two major areas to discuss: <li>Technical tools
  3. 3. Organizational hints
  4. 4. 80% is a 'should' not a 'must' </li></ul>
  5. 5. Technical tools <ul><li>The platform: *AMP
  6. 6. Developer sofware toolkit </li></ul>
  7. 7. LAMP / WAMP <ul><li>OS
  8. 8. Linux / Windows / Virtual Machine </li></ul>
  9. 9. LAMP / WAMP <ul><li>Webserver
  10. 10. Apache / nginx / Microsoft IIS
  11. 11. Any Apache version is fine (1.3, 2.0, 2.2) .
  12. 12. Enable mod_rewrite . </li></ul>
  13. 13. LAMP / WAMP <ul><li>Database
  14. 14. MySQL / Postgres / SQLite
  15. 15. SQLite implementation is still weak;
  16. 16. Postgres users may have problem with some modules </li></ul>
  17. 17. Tune MySQL <ul>Adjust default MySQL 5.x settings <li>innodb_buffer_pool_size = 256M
  18. 18. innodb_flush_log_at_trx_commit=2
  19. 19. innodb_flush_method=O_DIRECT
  20. 20. innodb_log_file_size = 128M
  21. 21. innodb_log_buffer_size = 4M </li></ul>
  22. 22. LAMP / WAMP PHP 5.2 PHP 5.3+ Drupal 5 + Drupal 6 + Drupal 7 + + Drupal 8 +
  23. 23. Tune PHP <ul>Tune PHP modules / settings </ul>php5-gd, php5-xdebug, php5-pdo, php5-mysql(i), php5-xml memory_limit 128M (check) register_global off max_execution_time 30 sendmail or module SMTP
  24. 24. Development tools: debugging <ul><li>Use xdebug (default port: 9000)
  25. 25. Use the 'watchdog' function </li></ul>watchdog( 'Apache Solr', 'Adding @count documents.', array('@count' => count($documents)) );
  26. 26. 'watchdog' function result <ul><li>http://example/admin/reports/dblog </li></ul>
  27. 27. <ul><li>Arrays, arrays, more arrays, nested arrays, ... </li></ul><ul>object(stdClass)[57] … public 'rdf_mapping' => array 'rdftype' => array 0 => string 'sioc:UserAccount' (length=16) 'name' => array 'predicates' => array … 'homepage' => array 'predicates' => array … 'type' => string 'rel' (length=3) <li>Use dpm() function from the module 'devel' </li></ul>
  28. 28. Need to run quick PHP snippet? Such things are nice: http://ideone.com (no Drupal there) However this is better: http://example.local/devel/php (by devel module, with Drupal stuff)
  29. 29. Environment tools <ul><li>Version control system
  30. 30. Integrated development environment
  31. 31. Drupal ecosystem
  32. 32. We're at 50% of slides! </li></ul>
  33. 33. Version control system <ul>Git / SVN / Mercurial <li>SVN – simple, centralized
  34. 34. Git – complicated, native for Drupal, powerful
  35. 35. Mercurial – in between
  36. 36. CVS – outdated!
  37. 37. Other: Bazaar, MS TFS (former VSS) </li></ul>
  38. 38. Use IDE <ul><li>IDE
  39. 39. NetBeans / Eclipse / CodeLobster
  40. 40. Provides syntax highlighting, autocompletion, integration with debugging and VCS. </li></ul>
  41. 41. Environment tools <ul><li>Install several browsers for different user roles
  42. 42. or
  43. 43. use Masquerade module </li></ul>Often you'll need to see the site by different groups of users – administrators, anonymous users, registered users, etc . Several browsers is more preferable – this have other usage as well.
  44. 44. Respect Drupal ecosystem <ul><li>Drupal directory structure
  45. 45. PHP/Drupal coding style
  46. 46. Doxygen </li></ul>
  47. 47. Location of custom code / themes <ul><li>Place all downloaded and handmade packages under
  48. 48. sites/all/modules/ , sites/all/themes/
  49. 49. Even better is to split
  50. 50. sites/all/modules/contrib/
  51. 51. sites/all/modules/custom/ </li></ul>
  52. 52. Drupal ecosystem <ul>Follow the coding style. Use correct variable_names, ClassNames,tab settings, comments. see </ul>http://drupal.org/coding-standards
  53. 53. Respect Doxygen headers. <ul>That is the reason why do we have nice documentation out-of-box at http://api.drupal.org . /** * Fetches a user object based on * an external authentication source. * * @param string $authname * The external authentication username. * * @return * A fully-loaded user object if the user * is found or FALSE if not found. */ function user_external_load($authname) { </ul>
  54. 54. BONUS TRACK: I NEED MORE!!
  55. 55. What's next? <ul><li>Nice FF plugins like Poster https://addons.mozilla.org/en-US/firefox/addon/poster/
  56. 56. Firebug, extended integration http://drupal.org/project/drupalforfirebug
  57. 57. Drush – DRUpal Shell
  58. 58. TRAC/RedMine
  59. 59. PHP 5.2/PHP 5.3 on the same machine
  60. 60. APC/xCache/eAccelerator
  61. 61. Contribute!
  62. 62. Make session </li></ul>
  63. 63. Useful links <ul><li>http://drupal.org/requirements
  64. 64. http://www.denwer.ru
  65. 65. http://drupal.org/requirements
  66. 66. http://drupal.org/project/smtp
  67. 67. http://localhost/phpinfo.php :)
  68. 68. http://drupal.org/project/devel
  69. 69. http://drupal.org/project/coder
  70. 70. http://git-scm.com/
  71. 71. http://drupal.org/project/masquerade
  72. 72. http://ideone.com
  73. 73. http://example.local/devel/php
  74. 74. http://drupal.org/coding-standards
  75. 75. http://api.drupal.org
  76. 76. http://drupal.org/project/drupalforfirebug </li></ul>
  77. 77. Thank you! <ul>Dennis Povshedny Freelance IT expert +38 096 2323346 Skype: djdenikin http://drupal.org/user/117896 </ul>

×