SlideShare uma empresa Scribd logo
1 de 31
プラグイン活用法
 quality use of Plugin



      slywalker
About me
原田 康生 Yasuo Harada
 大阪のこっそりPHPer
 Sly PHPer in Osaka

Blog 「忍び歩く男 - SLYWALKER」
 http://d.hatena.ne.jp/slywalker/

Twitter, Wassr, Hatena, GitHub ID
 slywalker
一瞬だけコミッターになれました
  I became a committer just a moment.
第4回CakePHP勉強会にて
      「プラグイン3段活用」
        LTで発表しました
           I made a presentation about Plugin
               at 4th CakePHP Workshop.
http://d.hatena.ne.jp/slywalker/20090523/1243059244
簡単お手軽にプラグインを
扱う方法を紹介しました
 I demonstrated how easily handle Plugin.
1. 整 理 整 頓                smarten up


  機能ごとにプラグイン化する
  Create a Plugin for each feature

2. 道 具 箱            tool box


  汎用的なプラグインをアプリケーションで共有
  To share a generic plug-in application

3. プラグイン                  Plugin


  開発しながら修復。完成度を高めていく
  Repair and development.
  Gradually increase the degree of completion
エンタープライズ Rails
「企業ユーザのための
Webアプリケーション設計術」


2章 プラグインによる構成
プラグインといえばDebugKit
    http://thechaw.com/debug_kit
通常ならば
app/plugins/debug_kit
アプリケーションが
 複数あるときは?
共有ならば
ROOT/plugins/debug_kit
Each app
app/config/bootstrap.php

$pluginPaths = array(ROOT.DS.'plugins'.DS);
Call Plugin
app/app_controller.php

class AppController extends Controller {
� var $components = array('DebugKit.Toolbar');
}
Plugin Tips
・   config
・   multilingualization i18n(.pot .po)
・   template(.ctp) using in app
・   /css/images(.jpg .png .gif)
     in plugin s /vendors
Account Manager Plugin
http://github.com/slywalker/account_manager
smtp.php.default
Copy app/config/smtp.php

/**
 * SMTP_CONFIG
 **/
class SMTP_CONFIG {
 
� static $default = array(
� � 'host' => 'tls://smtp.gmail.com',
� � 'port' => 465,
� � 'from' => 'username@gmail.com',
� � 'user' => 'username',
� � 'pass' => 'password',
� � 'protocol' => 'SMTP_AUTH',
� );
}
users_controller.php

/**
  * _send
  *
  * @param string $to
  * @param string $subject
  * @param string $template
  * @param string $config
  * @return boolean
  * @author Yasuo Harada
  */
protected function _send(..., $config = 'default') {

 if (config('smtp')) {

 
 $params = SMTP_CONFIG::$$config;

 
 $this->Qdmail->smtp(true);

 
 $this->Qdmail->smtpServer($params);

 }

 ....
}
Multilingualization i18n in Plugin


                 __('Hello World');




   __d('account_manager', 'Hello World');

account_manager/locale/jpn/LC_MESSAGES/account_manager.po
$ cd /your_plugins_path/account_manager
   $ cake i18n

Welcome to CakePHP v1.2.4.8284 Console
---------------------------------------------------------------
App : account_manager
Path: /your_plugins_path/account_manager
---------------------------------------------------------------
I18n Shell
---------------------------------------------------------------
[E]xtract POT file from sources
[I]nitialize i18n database table
[H]elp
[Q]uit
What would you like to do? (E/I/H/Q)
>e
What is the full path you would like to extract?
Example: /your_plugins_path/myapp
[Q]uit
[/your_plugins_path/account_manager] > (enter)
What is the full path you would like to output?
Example: /your_plugins_path/account_manager/locale
[Q]uit
[/your_plugins_path/account_manager/locale] > (enter)

Extracting...
---------------------------------------------------------------
Path: /your_plugins_path/account_manager
Output Directory: /your_plugins_path/account_manager/locale/
---------------------------------------------------------------
Would you like to merge all translations into one file? (y/n)
[y] > (enter)
What should we name this file?
[default] > account_manager
If you want use your template.
Template using in app
    use Themed

�   app_controller.php

�   class AppController extends Controller {
�   � function beforeFilter() {
�   � � if (isset($this->params['plugin'])) {
�   � � � $this->view = 'Theme';
�   � � � $this->theme = $this->params['plugin'];
�   � � }
�   � }
�   }
Template using in app
   Copy account_manager/views/users




app/views/themed/account_manager/users
View search order

1.   themed
2.   plugin
3.   app
4.   core
Jquery Plugin
http://github.com/slywalker/jquery
Using JqueryUI
  http://jqueryui.com/
Default Dispatcher
Request images/bg.png in css

app/webroot/css/images/bg.png <- Get!!
app/vendors/css/images/bg.png <- Get!!
app/plugins/vendors/css/images/bg.png <- Ooops!!
vendors/css/images/bg.png <- Get!!
plugins/vendors/css/images/bg.png <- Ooops!!
Custom Dispatcher
jquery/dispatcher.php

class Dispatcher extends Object {
�   function cached($url) {
�   �    ...
�   �    �   foreach ($assets as $type => $contentType) {
�   �    �   �    if ($type === $ext) {
�   �    �   �    �    if ($type === 'css' || $type === 'js') {
�   �    �   �    �    �    $pos = strpos($url, $type . '/');
�   �    �   �    �    } else {
�   �    �   �    �    �    $pos = strpos($url, 'img/');
�   �    �   �    �    �    // add by slywalker start
�   �    �   �    �    �    if ($pos === false) {
�   �    �   �    �    �    �    $pos = strpos($url, 'js/');
�   �    �   �    �    �    }
�   �    �   �    �    �    if ($pos === false) {
�   �    �   �    �    �    �    $pos = strpos($url, 'css/');
�   �    �   �    �    �    }
�   �    �   �    �    �    // add by slywalker end
�   �    �   �    �    }
�   �    �   �    �    $isAsset = true;
�   �    �   �    �    break;
�   �    �   �    }
�   �    �   }
�   �    ...
�   }
}
Custom Dispatcher
Request images/bg.png in css

app/webroot/css/images/bg.png <- Get!!
app/vendors/css/images/bg.png <- Get!!
app/plugins/vendors/css/images/bg.png <- Get!!
vendors/css/images/bg.png <- Get!!
plugins/vendors/css/images/bg.png <- Get!!
Using Custom
             Dispatcher
app/config/bootstrap.php

App::import('Core', 'Dispatcher',array(
� 'file' => ROOT.DS.'jquery'.DS.'dispatcher.php'));
In closing,
I would like to thank you all
for listening so attentively.

Mais conteúdo relacionado

Mais procurados

Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmersxSawyer
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesAlbert Jessurum
 
With a Mighty Hammer
With a Mighty HammerWith a Mighty Hammer
With a Mighty HammerBen Scofield
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud CastlesBen Scofield
 
優しいWAFの作り方
優しいWAFの作り方優しいWAFの作り方
優しいWAFの作り方techmemo
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application frameworktechmemo
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hopeMarcus Ramberg
 
Building Cloud Castles - LRUG
Building Cloud Castles - LRUGBuilding Cloud Castles - LRUG
Building Cloud Castles - LRUGBen Scofield
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationAbdul Malik Ikhsan
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and othersYusuke Wada
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers StealBen Scofield
 

Mais procurados (20)

Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmers
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
Puppet modules for Fun and Profit
Puppet modules for Fun and ProfitPuppet modules for Fun and Profit
Puppet modules for Fun and Profit
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
 
With a Mighty Hammer
With a Mighty HammerWith a Mighty Hammer
With a Mighty Hammer
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
 
Dancing Tutorial
Dancing TutorialDancing Tutorial
Dancing Tutorial
 
優しいWAFの作り方
優しいWAFの作り方優しいWAFの作り方
優しいWAFの作り方
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
Mojolicious on Steroids
Mojolicious on SteroidsMojolicious on Steroids
Mojolicious on Steroids
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
Building Cloud Castles - LRUG
Building Cloud Castles - LRUGBuilding Cloud Castles - LRUG
Building Cloud Castles - LRUG
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
Perl5i
Perl5iPerl5i
Perl5i
 
Mojo as a_client
Mojo as a_clientMojo as a_client
Mojo as a_client
 

Destaque

究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指すYasuo Harada
 
Chapter 2 – Near East
Chapter 2 – Near East Chapter 2 – Near East
Chapter 2 – Near East Laura Moakley
 
Babylon system found in the web
Babylon system found in the webBabylon system found in the web
Babylon system found in the webYasuo Harada
 
フレームワークの選び方・付き合い方
フレームワークの選び方・付き合い方フレームワークの選び方・付き合い方
フレームワークの選び方・付き合い方Yasuo Harada
 
PHP Conference Kansai 2015
PHP Conference Kansai 2015PHP Conference Kansai 2015
PHP Conference Kansai 2015Yasuo Harada
 

Destaque (6)

究極のコントローラを目指す
究極のコントローラを目指す究極のコントローラを目指す
究極のコントローラを目指す
 
Chapter 2 – Near East
Chapter 2 – Near East Chapter 2 – Near East
Chapter 2 – Near East
 
Babylon system found in the web
Babylon system found in the webBabylon system found in the web
Babylon system found in the web
 
フレームワークの選び方・付き合い方
フレームワークの選び方・付き合い方フレームワークの選び方・付き合い方
フレームワークの選び方・付き合い方
 
Packagist
PackagistPackagist
Packagist
 
PHP Conference Kansai 2015
PHP Conference Kansai 2015PHP Conference Kansai 2015
PHP Conference Kansai 2015
 

Semelhante a Quality Use Of Plugin

Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Michelangelo van Dam
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)arcware
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)andrewnacin
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastMichelangelo van Dam
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Anatoly Sharifulin
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP pluginsPierre MARTIN
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 
Curscatalyst
CurscatalystCurscatalyst
CurscatalystKar Juan
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesSiarhei Barysiuk
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsDylan Jay
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門lestrrat
 
WordPress Plugin development
WordPress Plugin developmentWordPress Plugin development
WordPress Plugin developmentMostafa Soufi
 
Laying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentLaying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentTammy Hart
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principlesPerl Careers
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplicationolegmmiller
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 

Semelhante a Quality Use Of Plugin (20)

Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP plugins
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best Practices
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
WordPress Plugin development
WordPress Plugin developmentWordPress Plugin development
WordPress Plugin development
 
Laying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentLaying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme development
 
Pluggin creation
Pluggin creationPluggin creation
Pluggin creation
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 

Último

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Quality Use Of Plugin

  • 2. About me 原田 康生 Yasuo Harada 大阪のこっそりPHPer Sly PHPer in Osaka Blog 「忍び歩く男 - SLYWALKER」 http://d.hatena.ne.jp/slywalker/ Twitter, Wassr, Hatena, GitHub ID slywalker
  • 3. 一瞬だけコミッターになれました I became a committer just a moment.
  • 4. 第4回CakePHP勉強会にて 「プラグイン3段活用」 LTで発表しました I made a presentation about Plugin at 4th CakePHP Workshop. http://d.hatena.ne.jp/slywalker/20090523/1243059244
  • 6. 1. 整 理 整 頓 smarten up 機能ごとにプラグイン化する Create a Plugin for each feature 2. 道 具 箱 tool box 汎用的なプラグインをアプリケーションで共有 To share a generic plug-in application 3. プラグイン Plugin 開発しながら修復。完成度を高めていく Repair and development. Gradually increase the degree of completion
  • 8. プラグインといえばDebugKit http://thechaw.com/debug_kit
  • 12. Each app app/config/bootstrap.php $pluginPaths = array(ROOT.DS.'plugins'.DS);
  • 13. Call Plugin app/app_controller.php class AppController extends Controller { � var $components = array('DebugKit.Toolbar'); }
  • 14. Plugin Tips ・ config ・ multilingualization i18n(.pot .po) ・ template(.ctp) using in app ・ /css/images(.jpg .png .gif) in plugin s /vendors
  • 16. smtp.php.default Copy app/config/smtp.php /**  * SMTP_CONFIG  **/ class SMTP_CONFIG {   � static $default = array( � � 'host' => 'tls://smtp.gmail.com', � � 'port' => 465, � � 'from' => 'username@gmail.com', � � 'user' => 'username', � � 'pass' => 'password', � � 'protocol' => 'SMTP_AUTH', � ); }
  • 17. users_controller.php /** * _send * * @param string $to * @param string $subject * @param string $template * @param string $config * @return boolean * @author Yasuo Harada */ protected function _send(..., $config = 'default') { if (config('smtp')) { $params = SMTP_CONFIG::$$config; $this->Qdmail->smtp(true); $this->Qdmail->smtpServer($params); } .... }
  • 18. Multilingualization i18n in Plugin __('Hello World'); __d('account_manager', 'Hello World'); account_manager/locale/jpn/LC_MESSAGES/account_manager.po
  • 19. $ cd /your_plugins_path/account_manager $ cake i18n Welcome to CakePHP v1.2.4.8284 Console --------------------------------------------------------------- App : account_manager Path: /your_plugins_path/account_manager --------------------------------------------------------------- I18n Shell --------------------------------------------------------------- [E]xtract POT file from sources [I]nitialize i18n database table [H]elp [Q]uit What would you like to do? (E/I/H/Q) >e
  • 20. What is the full path you would like to extract? Example: /your_plugins_path/myapp [Q]uit [/your_plugins_path/account_manager] > (enter) What is the full path you would like to output? Example: /your_plugins_path/account_manager/locale [Q]uit [/your_plugins_path/account_manager/locale] > (enter) Extracting... --------------------------------------------------------------- Path: /your_plugins_path/account_manager Output Directory: /your_plugins_path/account_manager/locale/ --------------------------------------------------------------- Would you like to merge all translations into one file? (y/n) [y] > (enter) What should we name this file? [default] > account_manager
  • 21. If you want use your template.
  • 22. Template using in app use Themed � app_controller.php � class AppController extends Controller { � � function beforeFilter() { � � � if (isset($this->params['plugin'])) { � � � � $this->view = 'Theme'; � � � � $this->theme = $this->params['plugin']; � � � } � � } � }
  • 23. Template using in app Copy account_manager/views/users app/views/themed/account_manager/users
  • 24. View search order 1. themed 2. plugin 3. app 4. core
  • 26. Using JqueryUI http://jqueryui.com/
  • 27. Default Dispatcher Request images/bg.png in css app/webroot/css/images/bg.png <- Get!! app/vendors/css/images/bg.png <- Get!! app/plugins/vendors/css/images/bg.png <- Ooops!! vendors/css/images/bg.png <- Get!! plugins/vendors/css/images/bg.png <- Ooops!!
  • 28. Custom Dispatcher jquery/dispatcher.php class Dispatcher extends Object { � function cached($url) { � � ... � � � foreach ($assets as $type => $contentType) { � � � � if ($type === $ext) { � � � � � if ($type === 'css' || $type === 'js') { � � � � � � $pos = strpos($url, $type . '/'); � � � � � } else { � � � � � � $pos = strpos($url, 'img/'); � � � � � � // add by slywalker start � � � � � � if ($pos === false) { � � � � � � � $pos = strpos($url, 'js/'); � � � � � � } � � � � � � if ($pos === false) { � � � � � � � $pos = strpos($url, 'css/'); � � � � � � } � � � � � � // add by slywalker end � � � � � } � � � � � $isAsset = true; � � � � � break; � � � � } � � � } � � ... � } }
  • 29. Custom Dispatcher Request images/bg.png in css app/webroot/css/images/bg.png <- Get!! app/vendors/css/images/bg.png <- Get!! app/plugins/vendors/css/images/bg.png <- Get!! vendors/css/images/bg.png <- Get!! plugins/vendors/css/images/bg.png <- Get!!
  • 30. Using Custom Dispatcher app/config/bootstrap.php App::import('Core', 'Dispatcher',array( � 'file' => ROOT.DS.'jquery'.DS.'dispatcher.php'));
  • 31. In closing, I would like to thank you all for listening so attentively.

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n