Пример #1
0
<?php

use RestPHP\RestPHP;
error_reporting(E_ERROR | E_WARNING | E_PARSE);
define('APP_PATH', './Application/');
include_once 'RestPHP/RestPHP.php';
$app = new RestPHP();
$app->run();
Пример #2
0
 private function _build($filepath, $context)
 {
     $filepath = APP_PATH . '/' . $filepath;
     $filepath = str_replace("//", "/", $filepath);
     if (!file_exists(dirname($filepath))) {
         $this->_mkdir(dirname($filepath));
     }
     if (file_exists($filepath)) {
         RestPHP::error($filepath . '已存在,跳过!', 'error');
     } else {
         file_put_contents($filepath, $context);
         RestPHP::error($filepath . '生成成功!', 'success');
     }
 }