Example #1
0
<?php

require 'RestServer.php';
require 'TestController.php';
$server = new RestServer('debug');
$server->addClass('TestController');
$server->handle();
Example #2
0
<?php

//spl_autoload_register();
set_include_path(get_include_path() . PATH_SEPARATOR . 'src');
require_once 'src/bootstrap.php';
require_once 'src/controller_mwp.php';
require_once 'vendor/jacwright/restserver/RestServer.php';
$doapi = true;
if ($doapi) {
    $mode = 'debug';
    $server = new RestServer($mode);
    $server->addClass('MWP_Controller');
    $server->addClass('WP_Sites', '/sites');
    $server->handle();
} else {
    include 'html/home.html';
}
Example #3
0
        // delete file if it exists
        $createFile = $path . '/' . $filename;
        if (is_file($createFile)) {
            unlink($createFile);
        }
        move_uploaded_file($tmp_file, $createFile);
    } else {
        throw new Exception('Could not copy file');
    }
}
function deleteDirectory($directory)
{
    //throw new RestException(400,$directory);
    if (!is_dir($directory)) {
        return;
    }
    // delete content
    $files = glob($directory . '/*', GLOB_MARK);
    foreach ($files as $file) {
        unlink($file);
    }
    //delete empty directory
    rmdir($directory);
}
spl_autoload_register();
// don't load our classes unless we use them
$mode = 'debug';
// 'debug' or 'production'
$server = new RestServer($mode);
$server->addClass('Controller');
$server->handle();
Example #4
0
<?php

//define('ABS_PATH', str_replace('\\', '/', dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . '/')));
//require_once ABS_PATH . 'oc-load.php';
require_once '../../oc-load.php';
require_once '../RestServer.php';
require_once '../RestDAO.php';
require_once 'apiServer.php';
$server = new RestServer('debug');
//$server->refreshCache();
$server->addClass('apiServer');
$server->handle();
Example #5
0
<?php

function __autoload($class_name)
{
    include $class_name . '.php';
}
//spl_autoload_register(); // don't load our classes unless we use them
$mode = 'debug';
// 'debug' or 'production'
$server = new RestServer($mode);
//$server->refreshCache(); // uncomment momentarily to clear the cache if classes change in production mode
$server->addClass('NowController', '/kt/now.js');
$server->addClass('KtController', '/kt/kt.js');
$server->addClass('UserController', '/kt/user.js');
$server->addClass('TupleController', '/kt/tuple.js');
$server->addClass('LocController', '/kt/loc.js');
$server->addClass('BrowseController', '/kt/browse.js');
$server->addClass('NewController', '/kt/new.js');
$server->handle();
Example #6
0
 * domus.Link :: PHP Web-based frontend for Heyu (X10 Home Automation)
 * Copyright (c) 2007, Istvan Hubay Cebrian (istvan.cebrian@domus.link.co.pt)
 * Project's homepage: http://domus.link.co.pt
 * Project's dev. homepage: http://domuslink.googlecode.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope's that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details. You should have 
 * received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, 
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once "./apiinclude.php";
$dirname = dirname(__FILE__);
require_once $dirname . DIRECTORY_SEPARATOR . 'lib/classes/restserver.php';
require_once $dirname . DIRECTORY_SEPARATOR . 'api/domuscontroller.php';
spl_autoload_register();
// don't load our classes unless we use them
$mode = 'production';
// 'debug' or 'production'
$server = new RestServer($mode, "domus.Link", "db/");
# $server->refreshCache(); // uncomment momentarily to clear the cache if classes change in production mode
$config = $_SESSION['frontObj']->getConfig();
$server->addClass('DomusController', $config['url_path'] . "/api.php/");
$server->handle();
Example #7
0
<?php

spl_autoload_register();
$mode = 'debug';
$server = new RestServer($mode);
$server->refreshCache();
$server->addClass('UserController', 'user');
$server->addClass('HouseController', 'house');
$server->addClass('BillController', 'bill');
$server->addClass('ExpenseController', 'expense');
$server->addClass('DebtController', 'debt');
$server->handle();
Example #8
0
<?php

require_once 'lib/RestServer.php';
require_once 'lib/HSO.php';
$mode = 'debug';
// 'debug' or 'production'
$server = new RestServer($mode);
$server->refreshCache();
// uncomment momentarily to clear the cache if classes change in production mode
$server->addClass('HSO');
$server->handle();