WordPress
           (sotarok)
http://nequal.jp/
twitter.com/sotarok
•                    (              `)

•   (   `)

•




        Copyright © nequal, Creative Commons Attribution-Noncomm...
sotarok



          •
          •
          •
          •
          • Ethna
          • nequal

             Copyright © ...
•   CMS


•




          Copyright © nequal, Creative Commons Attribution-Noncommercial
                                 ...
•                                    Website
                                     on
    –                                ...
• PHP              2009
  – http://phpcon.php.gr.jp/2009/
  –         WordPress
  –        Program            WordPress


...
x WordPress                                      1


•
  WordPress
• WordPress




                Copyright © nequal, Cre...
x WordPress                                        2


•
•   WordPress




        Copyright © nequal, Creative Commons At...
WordPress
•
•

•                                                     WP

•




    Copyright © nequal, Creative Commons Attribution-...
WP
      • wp-content/themes/default
.                              |--      index.php
|--   404.php                  |-- ...
index.php
                               archive.php
                                single.php
                          ...
header.php
                                footer.php
                               sidebar.php
                         ...
header, footer
•
    get_header(), get_footer(),                          header.php,
    footer.php

        get_header()...
WP
•               WP                                             CSS



              header.php


         [[      WP   ...
header.php
•
•




             Copyright © nequal, Creative Commons Attribution-Noncommercial
                           ...
header.php
<?php
// ethna
    •
require_once dirname(__FILE__) .
'/../../../../../app/Pcj_Controller.php';
$ethna = new Pc...
header.php
<?php
// ethna
    •
require_once dirname(__FILE__) .
'/../../../../../app/Pcj_Controller.php';
$ethna = new Pc...
header.php
<?php
// ethna
    •                       Ethna
require_once dirname(__FILE__) .        Smarty
'/../../../../....
header.php
<?php
// ethna
    •
require_once dirname(__FILE__) .
'/../../../../../app/Pcj_Controller.php';
$ethna = new Pc...
header.php
<?php if ( is_singular() )
wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<?php
echo $renderer->...
header.php
...
<?php if ( is_singular() )
wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<?php
echo $render...
header.php
...
<?php if ( is_singular() )
wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<?php
echo $render...
• WP
    – header, footer                                             OK
•



•
    – WordPress

       •   Ethna



     ...
WordPress
WP

•
    –                   wp-config.php
• DB




        Copyright © nequal, Creative Commons Attribution-Noncommercia...
• Ethna   PHP
  – Symfony yaml


• ETHNA/etc/appid-ini.php
• ETHNA/www/blog/wp-config.php




                   Copyright...
• ETHNA/www/blog/wp-config.php

<?php
/**
 * WordPress
 *
...

 */

/**
 * Ethna                          ethna ini.php
 *...
• ETHNA/etc/pcj-ini.php

<?php
/*
 * pcj-ini.php
 *
 * WP              define
 * WP    wp-config                         r...
• ETHNA/etc/pcj-ini.php (                )

$config = array(
    // site
    'url' => 'http://phpcon.php.gr.jp/',

     //...
WP
•              DB
    –   wp_comments
    –   wp_links
    –   wp_options
    –   wp_postmeta
    –   wp_posts
    –   ...
• Ethna
      ORM
<?php

class Pcj_DB_WpPosts extends Pcj_DB
{
    public $table_name = 'wp_posts';
}
    •

        –    ...
$entry = $this->db->Wp_Posts->find(
           D::D_FIRST,
           array(
               'post_status' => 'publish',
  ...
•   /
•
•                HTML
•
•
•
•




        Copyright © nequal, Creative Commons Attribution-Noncommercial
         ...
•
        SQL

•
    –         WP

    –




              Copyright © nequal, Creative Commons Attribution-Noncommercial
...
->
•
•
•
•




         Copyright © nequal, Creative Commons Attribution-Noncommercial
                                   ...
• WP

•                                         WP
             (^^;
•      PHP
         (

•



                Copyright...
• WordPress
    –
•
    – 1.
        • WP
        •
    – 2. DB
        • DB
        •



               Copyright © nequa...
Question?
フレームワークxWordPress
Upcoming SlideShare
Loading in …5
×

フレームワークxWordPress

3,410 views
3,335 views

Published on

@WordPressセミナー '09/9/8

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

No Downloads
Views
Total views
3,410
On SlideShare
0
From Embeds
0
Number of Embeds
585
Actions
Shares
0
Downloads
12
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

フレームワークxWordPress

  1. 1. WordPress (sotarok) http://nequal.jp/ twitter.com/sotarok
  2. 2. • ( `) • ( `) • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  3. 3. sotarok • • • • • Ethna • nequal Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  4. 4. • CMS • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  5. 5. • Website on – some framework • – – • WordPress Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  6. 6. • PHP 2009 – http://phpcon.php.gr.jp/2009/ – WordPress – Program WordPress Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  7. 7. x WordPress 1 • WordPress • WordPress Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  8. 8. x WordPress 2 • • WordPress Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  9. 9. WordPress
  10. 10. • • • WP • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  11. 11. WP • wp-content/themes/default . |-- index.php |-- 404.php |-- ja.mo |-- archive.php |-- ja.po |-- archives.php |-- kubrick.pot |-- comments-popup.php |-- links.php |-- comments.php |-- page.php |-- footer.php |-- rtl.css |-- functions.php |-- screenshot.png |-- header.php |-- search.php |-- image.php |-- sidebar.php |-- images |-- single.php | |-- audio.jpg `-- style.css | |-- ... Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  12. 12. index.php archive.php single.php page.php ... Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  13. 13. header.php footer.php sidebar.php ... Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  14. 14. header, footer • get_header(), get_footer(), header.php, footer.php get_header(); header.php index.php get_footer(); footer.php Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  15. 15. WP • WP CSS header.php [[ WP ]] footer.php Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  16. 16. header.php • • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  17. 17. header.php <?php // ethna • require_once dirname(__FILE__) . '/../../../../../app/Pcj_Controller.php'; $ethna = new Pcj_Controller(); // $renderer =& $ethna->getRenderer(); $smarty =& $renderer->engine; $smarty->left_delimiter = '{{'; $smarty->right_delimiter = '}}'; $GLOBALS['ethna'] = array( 'ethna' => $ethna, 'renderer' => $renderer, 'smarty' => $smarty, Copyright © nequal, Creative Commons Attribution-Noncommercial ); 2.1 @ WordPress mini seminar.
  18. 18. header.php <?php // ethna • require_once dirname(__FILE__) . '/../../../../../app/Pcj_Controller.php'; $ethna = new Pcj_Controller(); // $renderer = $ethna->getRenderer(); $smarty = $renderer->engine; $smarty->left_delimiter = '{{'; $smarty->right_delimiter = '}}'; $GLOBALS['ethna'] = array( 'ethna' => $ethna, 'renderer' => $renderer, 'smarty' => $smarty, Copyright © nequal, Creative Commons Attribution-Noncommercial ); 2.1 @ WordPress mini seminar.
  19. 19. header.php <?php // ethna • Ethna require_once dirname(__FILE__) . Smarty '/../../../../../app/Pcj_Controller.php'; $ethna = new Pcj_Controller(); // $renderer = $ethna->getRenderer(); $smarty = $renderer->engine; $smarty->left_delimiter = '{{'; $smarty->right_delimiter = '}}'; $GLOBALS['ethna'] = array( 'ethna' => $ethna, 'renderer' => $renderer, 'smarty' => $smarty, Copyright © nequal, Creative Commons Attribution-Noncommercial ); 2.1 @ WordPress mini seminar.
  20. 20. header.php <?php // ethna • require_once dirname(__FILE__) . '/../../../../../app/Pcj_Controller.php'; $ethna = new Pcj_Controller(); footer.php // $renderer = $ethna->getRenderer(); $smarty = $renderer->engine; $smarty->left_delimiter = '{{'; $smarty->right_delimiter = '}}'; $GLOBALS['ethna'] = array( 'ethna' => $ethna, 'renderer' => $renderer, 'smarty' => $smarty, Copyright © nequal, Creative Commons Attribution-Noncommercial ); 2.1 @ WordPress mini seminar.
  21. 21. header.php <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> <?php echo $renderer->perform('layout/header.tpl', true); echo $renderer->perform('layout/globalnavi.tpl', true); ?> <div id="main"> Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  22. 22. header.php ... <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> <?php echo $renderer->perform('layout/header.tpl', true); WP echo $renderer->perform('layout/globalnavi.tpl', true); ?> <div id="main"> OK HTML Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  23. 23. header.php ... <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> <?php echo $renderer->perform('layout/header.tpl', true); echo $renderer->perform('layout/globalnavi.tpl', true); ?> <div id="main"> Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  24. 24. • WP – header, footer OK • • – WordPress • Ethna Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  25. 25. WordPress
  26. 26. WP • – wp-config.php • DB Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  27. 27. • Ethna PHP – Symfony yaml • ETHNA/etc/appid-ini.php • ETHNA/www/blog/wp-config.php Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  28. 28. • ETHNA/www/blog/wp-config.php <?php /** * WordPress * ... */ /** * Ethna ethna ini.php */ require_once dirname(__FILE__) nequal,'/../../etc/pcj- Copyright © . Creative Commons Attribution-Noncommercial ini.php'; 2.1 @ WordPress mini seminar.
  29. 29. • ETHNA/etc/pcj-ini.php <?php /* * pcj-ini.php * * WP define * WP wp-config require * */ define('DB_NAME', 'dbname'); define('DB_USER', 'dbusername'); define('DB_PASSWORD', 'dbpassword'); Commons Attribution-Noncommercial Copyright © nequal, Creative define('DB_HOST', 'localhost'); 2.1 @ WordPress mini seminar.
  30. 30. • ETHNA/etc/pcj-ini.php ( ) $config = array( // site 'url' => 'http://phpcon.php.gr.jp/', // debug // false 'debug' => false, // db // sample-1: single db 'dsn' => 'mysql://' . DB_USER . ':' . DB_PASSWORD . '@' . DB_HOST . © '/' Creative Commons Attribution-Noncommercial Copyright nequal, . DB_NAME, ... 2.1 @ WordPress mini seminar.
  31. 31. WP • DB – wp_comments – wp_links – wp_options – wp_postmeta – wp_posts – wp_terms – wp_term_relationships – wp_term_taxonomy – wp_usermeta – wp_users Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  32. 32. • Ethna ORM <?php class Pcj_DB_WpPosts extends Pcj_DB { public $table_name = 'wp_posts'; } • – ORM Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  33. 33. $entry = $this->db->Wp_Posts->find( D::D_FIRST, array( 'post_status' => 'publish', 'post_type' => 'post', 'order' => 'post_date DESC', ) ); $this->af->setApp('blog_post_data', $entry); Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  34. 34. • / • • HTML • • • • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  35. 35. • SQL • – WP – Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  36. 36. -> • • • • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  37. 37. • WP • WP (^^; • PHP ( • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  38. 38. • WordPress – • – 1. • WP • – 2. DB • DB • Copyright © nequal, Creative Commons Attribution-Noncommercial 2.1 @ WordPress mini seminar.
  39. 39. Question?

×