Changeset 1074

Show
Ignore:
Timestamp:
08/09/06 13:20:57 (2 years ago)
Author:
coolengineer
Message:

* blog/api/blogger.php
* blog/api/apicore.php
* blog/api/metaweblog.php

위 세 파일을 lib/model/api.php 로 통합함.

* lib/include.php

model/api.php를 포함시키도록 변경.

* blog/api/index.php

model/api.php를 사용하도록 수정

Location:
sandbox
Files:
1 added
3 removed
2 modified

Legend:

Unmodified
Added
Removed
  • sandbox/blog/api/index.php

    r1073 r1074  
    22define('ROOT', '../..'); 
    33require ROOT . '/lib/include.php'; 
    4 if (false) { 
    5     fetchConfigVal(); 
    6 } 
    7 /*--------- Debugging environment -----------*/ 
    8 global $debug, $debug_file, $blogapi_dir; 
    9 $debug = 0; /* DEBUGLOG */ 
    10 $debug_file = ROOT . "/.htdebug.log"; 
    11 $blogapi_dir = dirname( __FILE__ ); 
    124 
    13 if( $debug ) 
    14 { 
    15     global $debugfd, $debug_file; 
    16     $debugfd = fopen( $debug_file, "a" ); 
    17 } 
    18 else 
    19 { 
    20     if( file_exists( $debug_file ) ) 
    21     { 
    22         unlink( $debug_file ); 
    23     } 
    24 } 
    25  
    26 function DEBUG( $str, $internal = false) 
    27 { 
    28     global $debug, $debugfd; 
    29     if( !$debug ) 
    30     { 
    31         return ""; 
    32     } 
    33     if( $internal ) 
    34     { 
    35         $str = var_export( $str, true ); 
    36     } 
    37     fputs( $debugfd, $str ); 
    38 } 
     5requireComponent( "Eolin.PHP.XMLStruct" ); 
     6requireComponent( "Eolin.PHP.XMLTree" ); 
     7requireComponent( "Eolin.PHP.XMLRPC" ); 
     8requireComponent( "Tattertools.Control.RSS" ); 
     9requireComponent( "Tattertools.Control.Auth" ); 
     10requireComponent( "Tattertools.Data.Post" ); 
     11requireComponent( "Tattertools.Data.Category" ); 
    3912 
    4013/*--------- API main ---------------*/ 
    41 function BlogAPI() 
    42 { 
    43     include_once "apicore.php"; 
    44  
    45     api_BlogAPI(); 
    46     return ""; 
    47 } 
    48  
    49 function AddRSD($target) 
    50 { 
    51     global $hostURL, $blogURL; 
    52     $target .= '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$hostURL.$blogURL.'/api/rsd" />'.CRLF; 
    53     return $target; 
    54 } 
    5514 
    5615function SendRSD() 
     
    8241else 
    8342{ 
    84     BlogAPI(); 
     43    api_BlogAPI(); 
    8544} 
    8645?> 
  • sandbox/lib/include.php

    r720 r1074  
    1313require 'functions.php'; 
    1414require 'database.php'; 
     15require 'model/api.php'; 
    1516require 'model/service.php'; 
    1617require 'model/archive.php';