コード例 #1
0
 /**
  * _loadClassMapping - internal function for parsing class_mapping file 
  * 
  * @static
  * @access private
  * @return void
  */
 private static function _loadClassMapping()
 {
     $class_map_ini = BASE_PATH . '/lib/class_mapping.ini';
     if (file_exists($class_map_ini)) {
         $class_mapping = parse_ini_file($class_map_ini);
         //keys in arrays are case sensitive, classnames are not!
         self::$_classMapping = array_change_key_case($class_mapping, CASE_LOWER);
     } else {
         error_log('Saigon Autoloader: Could not load class mapping file at: ' . $class_map_ini);
         die;
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: NetworkCedu/saigon
//
// Copyright (c) 2013, Zynga Inc.
// https://github.com/zynga/saigon
// Author: Matt West (https://github.com/mhwest13)
// License: BSD 2-Clause
//
/*
 * Saigon API - Index
 */
// Lets load up the composer autoloader
require_once dirname(dirname(__FILE__)) . '/conf/saigon.inc.php';
require_once BASE_PATH . '/vendor/autoload.php';
// Lets load up the saigon autoloader
require_once BASE_PATH . '/lib/classLoader.class.php';
Saigon_ClassLoader::register();
// Lets start up Slim...
$app = new \Slim\Slim();
\Slim\Route::setDefaultConditions(array('deployment' => '[a-zA-Z0-9_-]{1,}', 'staged' => '[1]', 'merged' => '[1]'));
// Internal functions
function check_auth($app, $deployment)
{
    $amodule = AUTH_MODULE;
    $authmodule = new $amodule();
    $return = $authmodule->checkAuth($deployment);
    if ($return === false) {
        $apiResponse = new APIViewData(1, $deployment, "Invalid Login or Invalid Credentials Supplied");
        $app->halt(401, $apiResponse->returnJson());
    }
    return true;
}