SlideShare a Scribd company logo
ECOS
shopex
• svn co http://svn.ecos.shopex.cn/ecos/
  trunk/app/base base
• base/cmd
• windows    basecmd.bat
install
uninstall
search
update
createproject
trace             /
man ...
base:queue list
base:task list
base:task exec
createproject
base/cmd createproject bookstore
index.php
rpc.txt          ecos
app
config
    config.php
    mapper.php   URL - APP
data
• app/notebook/dbschema/item.php
 <?php
 $columns = array(
 	

 'item_id' => array ('type' => 'number','required' => true
 	

 	

  	

   	

 	

   	

 ,'extra' =>'auto_increment','pkey' => true),
 	

 'item_subject' => array ('type' => 'varchar(100)'),
 	

 'item_content' => array ('type' => 'text'),
 	

 'item_posttime' => array ('type' => 'time'),
 	

 'item_email' => array ('type' => 'email'),
 );
 $db['item'] = array('columns'=>$columns);
update
base/cmd update
• app/notebook/controller/default.php

   public function index(){
     $this->pagedata['items'] = $this->app->model('item')->getList('*');
     $this->display('list.html');
   }
• app/notebook/controller/default.php
    public function addnew(){
      $this->begin(array('ctl'=>'default','act'=>'index'));
      $data = array(
             'item_subject'=>$_POST['subject'],
             'item_content'=>$_POST['content'],
             'item_email'=>$_POST['email'],
             'item_posttime'=>time(),
          );
      $result = $this->app->model('item')->insert($data);
      $this->end($result);
    }
• app/notebook/controller/default.php
    public function index(){
      $this->pagedata['items'] = $this->app->model('item')->getList('*');

        //
        $gravatar = new notebook_gravatar;

        foreach($this->pagedata['items'] as $k=>$item){
           $this->pagedata['items'][$k]['avatar'] =
                 $gravatar->get_avatar($item['item_email']);
        }
        //

        $this->display('list.html');
    }
• app/notebook/lib/gravatar.php
   <?php
   class notebook_gravatar{

      function get_avatar($email){
         return sprintf('http://www.gravatar.com/avatar/%s?s=48&r=x',md5
   ($email));
      }

   }
include
                              ?

•   php5         , Autoload
•                  ,
    __autoload                .
ECOS


class
                            class ABC
     AAA_BBB_CCC_DDD
   App




                       app
app/AAA
                          /base
      /BBB
                             /lib
        /CCC
                               /statics
           /DDD.php
                                 /ABC.php
• app/notebook/view/list.html
   <dd>
       <!--                  -->
        <img src="<{$item.avatar}>" style="float:left;margin-
  right:10px" />
        <!--                  -->
        <{$item.item_content}>
    </dd>
•   ?
Service
Service


• App
• App
Service


• kernel::service('service_name')->method()
• foreach(kernel::servicelist('service_name')
  as $service_object){ ....
Service
•
        $this->pagedata['items'] = $this->app->model('item')->getList('*');

        //
        foreach(kernel::servicelist('notebook_addon') as
    $object){
           foreach($this->pagedata['items'] as $k=>$item){
              $this->pagedata['items'][$k]['addon'][] =
    $object->get_output($item);
           }
        }
        //

        $this->display('list.html');
Service
•
    <{foreach from=$items item=item}>
       <dt>
       <{$item.item_subject}>
       <span class="date">     : <{$item.item_posttime|cdate}></span>
       </dt>
       <dd>
       <!--                   -->
       <{foreach from=$item.addon item=block}>
          <{$block}>
       <{/foreach}>
       <!--                   -->
       <{$item.item_content}>
       </dd>
       <{/foreach}>
Service
• app/notebook/service.xml
  <services>
  	

 <service id="notebook_addon">
  	

 	

  <class>notebook_gravatar</class>
  	

 </service>
  </services>
Service
•
    base/app/cmd update
•                         app,
    notebook

•         app/alertnote
• app/alertnote/app.xml
  <app>
     <name>             </name>
     <description>              ...</description>
     <author>
        <name>somebody</name>
        <email>somebody@example.com</email>
        <url>http://www.example.com</url>
     </author>
     <depends>
        <app>notebook</app>
     </depends>
  </app>
• app/alertnote/services.xml
  <services>
  	

 <service id="notebook_addon">
  	

 	

  <class>alertnote_tools</class>
  	

 </service>
  </services>
• app/alertnote/lib/tools.php
  <?php
  class alertnote_tools{

      function get_output($item){
         return '<span style="color:red" onclick="alert('   !   !   !
  ')">      </span>';
      }

  }
app/base/cmd install alertnote
Installing... alertnote
Installing service notebook_addon
Application alertnote installed... ok.
实战Ecos
: Rewrite
        Querystring

index.php   ?/part1/part2/part3
: Rewrite
                              ECOS
        PATHINFO

         /
index.php part1/part2/part3
app
App
                  Base
•
•
    •
    •
    • key-value
    •
App
           setup

•
•   config/deploy.xml
App
                dbeav
• Entity-attribute-value model
•
• model::getList
App
    site

•
•
App
             content

•          CMS

•   Site
App
              image

•
•   service    ,
App
          desktop

•
•   pam
App
        ectools

•   ,    ,


•
App
              b2c

•         ,

•   pam
App
                 pam
• Pluggable Authentication Modules
•
•
•
App
                                        b2c

               content


site                               ectools




       image
                         desktop
                                              pam

  dev
                               dbeav



                base
ECOS

•
•
•
•    ,
FAQ

More Related Content

PDF
Silex Cheat Sheet
PDF
Rails 3 overview
PPTX
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
KEY
Single Page Web Apps with Backbone.js and Rails
PDF
Advanced RESTful Rails
PDF
Introducing Assetic: Asset Management for PHP 5.3
PDF
You're Doing it Wrong - WordCamp Atlanta
PPTX
Using the Features API
Silex Cheat Sheet
Rails 3 overview
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
Single Page Web Apps with Backbone.js and Rails
Advanced RESTful Rails
Introducing Assetic: Asset Management for PHP 5.3
You're Doing it Wrong - WordCamp Atlanta
Using the Features API

What's hot (19)

PDF
Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
PPT
WordPress as a Content Management System
PDF
Rails 3 Beautiful Code
PDF
Assetic (Symfony Live Paris)
PDF
Caldera Learn - LoopConf WP API + Angular FTW Workshop
PPTX
Magento Live Australia 2016: Request Flow
PDF
Be RESTful (Symfony Camp 2008)
PDF
Django Vs Rails
PDF
Action View Form Helpers - 1, Season 2
PPTX
Extend sdk
KEY
Apostrophe (improved Paris edition)
PDF
devise tutorial - 2011 rubyconf taiwan
KEY
And the Greatest of These Is ... Rack Support
PDF
Action Controller Overview, Season 2
DOCX
logic321
PPTX
15.exemplu complet eloquent view add-edit-delete-search
PDF
sfDay Cologne - Sonata Admin Bundle
PDF
Feeds drupal cafe
PDF
J queryui
Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
WordPress as a Content Management System
Rails 3 Beautiful Code
Assetic (Symfony Live Paris)
Caldera Learn - LoopConf WP API + Angular FTW Workshop
Magento Live Australia 2016: Request Flow
Be RESTful (Symfony Camp 2008)
Django Vs Rails
Action View Form Helpers - 1, Season 2
Extend sdk
Apostrophe (improved Paris edition)
devise tutorial - 2011 rubyconf taiwan
And the Greatest of These Is ... Rack Support
Action Controller Overview, Season 2
logic321
15.exemplu complet eloquent view add-edit-delete-search
sfDay Cologne - Sonata Admin Bundle
Feeds drupal cafe
J queryui
Ad

Viewers also liked (16)

PPTX
about me
PDF
商派电商基础设施产品
PPT
Congress 2010
PDF
Cummunity HUB - Youth Content Creation
PPT
Transformative Learning
PDF
Build your own wind turbine
PPT
First Year Teachers' Experiences Directing the Work of Educational Assistants...
KEY
Ecos rpc
PDF
PDF
1756 pm008 -en-p
PDF
商派信息安全解决方案
PDF
Ecos基础应用介绍
PPTX
什么是ECOS
PDF
Cummunity HUB - Our Beliefs
PDF
Bloomfilter
about me
商派电商基础设施产品
Congress 2010
Cummunity HUB - Youth Content Creation
Transformative Learning
Build your own wind turbine
First Year Teachers' Experiences Directing the Work of Educational Assistants...
Ecos rpc
1756 pm008 -en-p
商派信息安全解决方案
Ecos基础应用介绍
什么是ECOS
Cummunity HUB - Our Beliefs
Bloomfilter
Ad

Similar to 实战Ecos (20)

PDF
Cloudera Sessions - Clinic 3 - Advanced Steps - Fast-track Development for ET...
KEY
BEAR v0.9 (Saturday)
PDF
API Reliability Guide
PDF
Creating an Effective Mobile API
PDF
Refactoring to symfony components
ODP
Chisimba - introduction to practical demo
PDF
오픈소셜 어플리케이션 개발방안 이창명 연구원
PDF
HTML5 소개 및 배우기- HTML5 Open Conference
PDF
Symfony ORM
PDF
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
KEY
EvernoteAPI入門
KEY
Keeping It Small with Slim
PDF
Hosting as a Framework
KEY
Keeping it small: Getting to know the Slim micro framework
PDF
Why Memcached?
PDF
TurboGears2 Pluggable Applications
PDF
Tabledown
PDF
Cake php 1.2-cheatsheet
KEY
BEAR (Suday) design
PDF
Symfony2 from the Trenches
Cloudera Sessions - Clinic 3 - Advanced Steps - Fast-track Development for ET...
BEAR v0.9 (Saturday)
API Reliability Guide
Creating an Effective Mobile API
Refactoring to symfony components
Chisimba - introduction to practical demo
오픈소셜 어플리케이션 개발방안 이창명 연구원
HTML5 소개 및 배우기- HTML5 Open Conference
Symfony ORM
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
EvernoteAPI入門
Keeping It Small with Slim
Hosting as a Framework
Keeping it small: Getting to know the Slim micro framework
Why Memcached?
TurboGears2 Pluggable Applications
Tabledown
Cake php 1.2-cheatsheet
BEAR (Suday) design
Symfony2 from the Trenches

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Modernizing your data center with Dell and AMD
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
GamePlan Trading System Review: Professional Trader's Honest Take
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...

实战Ecos

  • 2. • svn co http://svn.ecos.shopex.cn/ecos/ trunk/app/base base
  • 4. install uninstall search update createproject trace / man ... base:queue list base:task list base:task exec
  • 6. index.php rpc.txt ecos app config config.php mapper.php URL - APP data
  • 7. • app/notebook/dbschema/item.php <?php $columns = array( 'item_id' => array ('type' => 'number','required' => true ,'extra' =>'auto_increment','pkey' => true), 'item_subject' => array ('type' => 'varchar(100)'), 'item_content' => array ('type' => 'text'), 'item_posttime' => array ('type' => 'time'), 'item_email' => array ('type' => 'email'), ); $db['item'] = array('columns'=>$columns);
  • 9. • app/notebook/controller/default.php public function index(){ $this->pagedata['items'] = $this->app->model('item')->getList('*'); $this->display('list.html'); }
  • 10. • app/notebook/controller/default.php public function addnew(){ $this->begin(array('ctl'=>'default','act'=>'index')); $data = array( 'item_subject'=>$_POST['subject'], 'item_content'=>$_POST['content'], 'item_email'=>$_POST['email'], 'item_posttime'=>time(), ); $result = $this->app->model('item')->insert($data); $this->end($result); }
  • 11. • app/notebook/controller/default.php public function index(){ $this->pagedata['items'] = $this->app->model('item')->getList('*'); // $gravatar = new notebook_gravatar; foreach($this->pagedata['items'] as $k=>$item){ $this->pagedata['items'][$k]['avatar'] = $gravatar->get_avatar($item['item_email']); } // $this->display('list.html'); }
  • 12. • app/notebook/lib/gravatar.php <?php class notebook_gravatar{ function get_avatar($email){ return sprintf('http://www.gravatar.com/avatar/%s?s=48&r=x',md5 ($email)); } }
  • 13. include ? • php5 , Autoload • , __autoload .
  • 14. ECOS class class ABC AAA_BBB_CCC_DDD App app app/AAA /base /BBB /lib /CCC /statics /DDD.php /ABC.php
  • 15. • app/notebook/view/list.html <dd> <!-- --> <img src="<{$item.avatar}>" style="float:left;margin- right:10px" /> <!-- --> <{$item.item_content}> </dd>
  • 16. ?
  • 20. Service • $this->pagedata['items'] = $this->app->model('item')->getList('*'); // foreach(kernel::servicelist('notebook_addon') as $object){ foreach($this->pagedata['items'] as $k=>$item){ $this->pagedata['items'][$k]['addon'][] = $object->get_output($item); } } // $this->display('list.html');
  • 21. Service • <{foreach from=$items item=item}> <dt> <{$item.item_subject}> <span class="date"> : <{$item.item_posttime|cdate}></span> </dt> <dd> <!-- --> <{foreach from=$item.addon item=block}> <{$block}> <{/foreach}> <!-- --> <{$item.item_content}> </dd> <{/foreach}>
  • 22. Service • app/notebook/service.xml <services> <service id="notebook_addon"> <class>notebook_gravatar</class> </service> </services>
  • 23. Service • base/app/cmd update
  • 24. app, notebook • app/alertnote
  • 25. • app/alertnote/app.xml <app> <name> </name> <description> ...</description> <author> <name>somebody</name> <email>somebody@example.com</email> <url>http://www.example.com</url> </author> <depends> <app>notebook</app> </depends> </app>
  • 26. • app/alertnote/services.xml <services> <service id="notebook_addon"> <class>alertnote_tools</class> </service> </services>
  • 27. • app/alertnote/lib/tools.php <?php class alertnote_tools{ function get_output($item){ return '<span style="color:red" onclick="alert(' ! ! ! ')"> </span>'; } }
  • 28. app/base/cmd install alertnote Installing... alertnote Installing service notebook_addon Application alertnote installed... ok.
  • 30. : Rewrite Querystring index.php ?/part1/part2/part3
  • 31. : Rewrite ECOS PATHINFO / index.php part1/part2/part3
  • 32. app
  • 33. App Base • • • • • key-value •
  • 34. App setup • • config/deploy.xml
  • 35. App dbeav • Entity-attribute-value model • • model::getList
  • 36. App site • •
  • 37. App content • CMS • Site
  • 38. App image • • service ,
  • 39. App desktop • • pam
  • 40. App ectools • , , •
  • 41. App b2c • , • pam
  • 42. App pam • Pluggable Authentication Modules • • •
  • 43. App b2c content site ectools image desktop pam dev dbeav base
  • 45. FAQ