예제 #1
0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
require_once 'WebUtil/Microsoft_Http_Response.php';
require_once 'WebUtil/HttpResponse.php';
require_once 'Common/ACSUtil.php';
/*
 * @copyright  Copyright (c) 2010, Persistent Systems Limited (http://www.persistentsys.com)
 * @license    http://odataphp.codeplex.com/license
 */
try {
    $util = new PHPSvcUtil($argv);
    $util->generateProxy();
    $options = $util->getOptions();
    echo "\n" . 'Done: OData Service Proxy File \'' . $options['/out_filename'] . '\' generated at ' . $options['/out_dir'] . "\n";
} catch (Exception $e) {
    $util->showUsageAndExit($e->getMessage());
}
class PHPSvcUtil
{
    protected $_validOptions = array('/config', '/uri', '/metadata', '/out', '/u', '/p', '/sn', '/at', '/auth', '/ph', '/pp', '/pu', '/ppwd', '/ups');
    protected $_auths = array('windows', 'acs');
    protected $_cmdArgs;
    protected $_options;
    protected $_metadataDoc;
    protected static $namespaces = array('EDM_2007_05' => 'http://schemas.microsoft.com/ado/2007/05/edm', 'EDM_2006_04' => 'http://schemas.microsoft.com/ado/2006/04/edm', 'EDM_2008_09' => 'http://schemas.microsoft.com/ado/2008/09/edm');
    protected static $QUERY_EDM_2007_05_ENTITYCONTAINER = '//EDM_2007_05:EntityContainer';
    protected static $QUERY_EDM_2006_04_ENTITYCONTAINER = '//EDM_2006_04:EntityContainer';
예제 #2
0
 * In order to speed up the use of this library in landscapes with
 * insanely complex include paths, utilize a means to directly reference
 * files for includes.
 */
// since this variable will be in the global namespace, give it a likely unique name
$PHPOData_Path = dirname(__FILE__);
require_once $PHPOData_Path . '/WebUtil/Microsoft_Http_Response.php';
require_once $PHPOData_Path . '/WebUtil/HttpResponse.php';
require_once $PHPOData_Path . '/Common/ACSUtil.php';
/*
 * @copyright  Copyright (c) 2010, Persistent Systems Limited (http://www.persistentsys.com)
 * @license    http://odataphp.codeplex.com/license
 */
try {
    $util = new PHPSvcUtil($argv);
    if ($util->generateProxy() !== false) {
        $options = $util->getOptions();
        echo 'OData Service Proxy File generated at ', $options['/out_dir'], '/', $options['/out_filename'], "\n";
    } else {
        echo 'An XSL Transform error occurred.', "\n";
        $errors = libxml_get_errors();
        foreach ($errors as $error) {
            echo $error, "\n";
        }
    }
} catch (Exception $e) {
    $util->showUsageAndExit($e->getMessage());
}
class PHPSvcUtil
{
    protected $_validOptions = array('/config', '/uri', '/metadata', '/out', '/u', '/p', '/sn', '/at', '/auth', '/ph', '/pp', '/pu', '/ppwd', '/ups', '/header');