Exemple #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';