Changeset 617

Show
Ignore:
Timestamp:
07/29/08 09:10:03 (4 months ago)
Author:
weyrick
Message:

more framework, for extensions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rphp/runtime/CMakeLists.txt

    r611 r617  
    1212  pOutputBuffer.cpp 
    1313  pOutputManager.cpp 
     14  pFunctionManager.cpp 
     15  pExtBase.cpp 
     16  pExtManager.cpp 
     17  standard/pStandardExt.cpp 
    1418) 
    1519 
  • trunk/rphp/runtime/include/pRuntime.h

    r610 r617  
    2121 
    2222#include "pTypes.h" 
    23 #include "pOutputManager.h" 
    2423 
    2524namespace rphp { 
     25 
     26    class pOutputManager; 
     27    class pExtManager; 
     28    class pFunctionManager; 
    2629 
    2730    class pRuntimeEngine { 
     
    3033 
    3134            // output buffering management 
    32             pOutputManager outputManager; 
     35            pOutputManager* outputManager; 
    3336             
    34             // function manager 
    35             // --> store list of available functions, including builtins (from extension manager) which stay on page reset, 
    36             //     and the currently defined via php code, which are reset each page 
    37             // --> interface for new function definition 
     37            // extension manager 
     38            // --> for loading and registering dynamic extensions (pcre, mysql, etc) and their associated functions, classes 
     39            pExtManager* extManager; 
    3840             
    3941            // class manager 
     
    4143            // --> interface for new class definition 
    4244             
    43             // extension manager 
    44             // --> for loading and registering dynamic extensions (pcre, mysql, etc) and their associated functions, classes 
    4545 
    4646            // global data: 
     
    5959 
    6060        public: 
    61             pRuntimeEngine() { } 
     61 
     62            pRuntimeEngine(); 
     63            ~pRuntimeEngine(); 
     64             
     65            // function manager 
     66            // --> store list of available functions, including builtins (from extension manager) which stay on page reset, 
     67            //     and the currently defined via php code, which are reset each page 
     68            // --> interface for new function definition 
     69            pFunctionManager* functionManager; 
    6270 
    6371    }; 
  • trunk/rphp/runtime/pHash.cpp

    r602 r617  
    2222 
    2323namespace boost { 
    24     std::size_t hash_value(rphp::hKeyVar const& k) { 
     24       std::size_t hash_value(rphp::hKeyVar const& k) { 
    2525        return boost::apply_visitor(rphp::hKeyHasher(), k); 
    2626    } 
     
    2828 
    2929namespace rphp { 
    30      
     30 
    3131    void pHash::insert(const pUString &key, pVarP data) { 
    3232        // TODO check numeric string, set maxIntKey accordingly 
     
    4646        hashData.insert(h_container(key, data)); 
    4747    } 
    48      
     48 
    4949    void pHash::insertNext(pVarP data) { 
    5050        hashData.insert(h_container(maxIntKey++, data)); 
     
    5454        return hashData.erase(key); 
    5555    } 
    56      
     56 
    5757    pHash::size_type pHash::remove(const pInt &key) { 
    5858        return hashData.erase(key); 
    5959    } 
    6060 
    61      
     61 
    6262    // query 
    6363    const bool pHash::keyExists(const pUString &key) { 
     
    7575        return (k != hashData.end()); 
    7676    } 
    77      
     77 
    7878    // lookup 
    7979    pVarP pHash::operator[] ( const pUString &key ) { 
     
    9494    } 
    9595    */ 
    96      
     96 
    9797    pVarP pHash::operator[] ( const pInt &key ) { 
    9898        stableHash::iterator k = hashData.find(key); 
     
    117117 
    118118        hKeyType kType; 
    119          
     119 
    120120        for (seq_index::iterator it = ot.begin(); it!=ot.end(); it++) { 
    121121            kType = boost::apply_visitor(rphp::hKeyGetType(), (*it).key); 
     
    130130    } 
    131131 
    132      
     132 
    133133} /* namespace rphp */ 
    134134 
  • trunk/rphp/runtime/pRuntime.cpp

    r598 r617  
    1919#include <iostream> 
    2020#include "pRuntime.h" 
     21#include "pExtManager.h" 
     22#include "pFunctionManager.h" 
    2123 
    2224namespace rphp { 
    2325 
     26pRuntimeEngine::pRuntimeEngine() : extManager(new pExtManager(this)), 
     27                                   functionManager(new pFunctionManager(this)) 
     28{ 
     29    // runtime initialization 
     30 
     31    // load standard extension 
     32     
     33} 
     34 
     35 
     36pRuntimeEngine::~pRuntimeEngine() { 
     37    // runtime shutdown  
     38    delete functionManager; 
     39    delete extManager; 
     40} 
    2441 
    2542}