How to? Drupal developer toolkit. Dennis Povshedny.
-
Upload
drupalcampdn -
Category
Technology
-
view
657 -
download
1
Transcript of How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit
Dennis Povshedny
http://donetsk.drupal.ua
How to? Drupal developer toolkit
Drupal Camp Donetsk
November 2011
Dennis Povshedny
Drupal developer toolkit
Two major areas to discuss:
Technical tools Organizational hints
80% is a 'should' not a 'must'
Technical tools
The platform: *AMP Developer sofware toolkit
LAMP / WAMP
OS Linux / Windows / Virtual Machine
LAMP / WAMP
Webserver Apache / nginx / Microsoft IIS
Any Apache version is fine (1.3, 2.0, 2.2) . Enable mod_rewrite .
LAMP / WAMP
Database MySQL / Postgres / SQLite
SQLite implementation is still weak; Postgres users may have problem with some
modules
Tune MySQL
Adjust default MySQL 5.x settings
innodb_buffer_pool_size = 256M innodb_flush_log_at_trx_commit=2 innodb_flush_method=O_DIRECT innodb_log_file_size = 128M innodb_log_buffer_size= 4M
LAMP / WAMP
Tune PHP
Tune PHP modules / settingsphp5-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
Development tools: debugging
Use xdebug (default port: 9000) Use the 'watchdog' function watchdog( 'Apache Solr',
'Adding @count documents.',
array('@count' => count($documents))
);
'watchdog' function result
http://example/admin/reports/dblog
● Arrays, arrays, more arrays, nested arrays, ...
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)
Use dpm() function from the module 'devel'
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)
Environment tools
Version control system Integrated development environment Drupal ecosystem
We're at 50% of slides!
Version control system
Git / SVN / Mercurial
SVN – simple, centralized Git – complicated, native for Drupal,
powerful Mercurial – in between CVS – outdated! Other: Bazaar, MS TFS (former VSS)
Use IDE
IDE NetBeans / Eclipse / CodeLobster
Provides syntax highlighting, autocompletion, integration with debugging and VCS.
Environment tools
Install several browsers for different user roles
or use Masquerade module
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.
Respect Drupal ecosystem
Drupal directory structure PHP/Drupal coding style Doxygen
Location of custom code / themes
Place all downloaded and handmade packages under
sites/all/modules/ , sites/all/themes/
Even better is to split sites/all/modules/contrib/ sites/all/modules/custom/
Drupal ecosystem
Follow the coding style.
Use correct variable_names, ClassNames,tab settings, comments. see
http://drupal.org/coding-standards
Respect Doxygen headers.
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) {
BONUS TRACK: I NEED MORE!!
What's next?
Nice FF plugins like Poster https://addons.mozilla.org/en-US/firefox/addon/poster/
Firebug, extended integration http://drupal.org/project/drupalforfirebug
Drush – DRUpal Shell TRAC/RedMine PHP 5.2/PHP 5.3 on the same machine APC/xCache/eAccelerator Contribute! Make session
Useful links http://drupal.org/requirements
http://www.denwer.ru
http://drupal.org/requirements
http://drupal.org/project/smtp
http://localhost/phpinfo.php :)
http://drupal.org/project/devel
http://drupal.org/project/coder
http://git-scm.com/
http://drupal.org/project/masquerade
http://ideone.com
http://example.local/devel/php
http://drupal.org/coding-standards
http://api.drupal.org
http://drupal.org/project/drupalforfirebug
Thank you!
Dennis Povshedny
Freelance IT expert
+38 096 2323346
Skype: djdenikin
http://drupal.org/user/117896