コード例 #1
0
ファイル: exampleCreate.php プロジェクト: 4np/GSCF-PHPClient
 *      http://www.apache.org/licenses/LICENSE-2.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.
 */
// enable error reporting for debugging
error_reporting(E_ALL);
ini_set('display_errors', true);
// require GSCF class
require_once "gscf.php";
// instantiate GSCF class and
// set api endpoint and credentials
$gscf = new GSCF();
$gscf->cachePath('/tmp');
$gscf->url('http://studies.mydomain.com');
// set this with the main GSCF URL
$gscf->username('');
// set this with the username
$gscf->password('');
// set this with the password
$gscf->apiKey('');
// set this with the api key for this user
// fetch all readable studies
//$studies = $gscf->getStudies();
//printf("%d studies\n",count($studies));
// get entity types
$entityTypes = $gscf->getEntityTypes();
print_r($entityTypes);
コード例 #2
0
ファイル: exampleFetch.php プロジェクト: 4np/GSCF-PHPClient
 *      http://www.apache.org/licenses/LICENSE-2.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.
 */
// enable error reporting for debugging
error_reporting(E_ALL);
ini_set('display_errors', true);
// require GSCF class
require_once "gscf.php";
// instantiate GSCF class and
// set api endpoint and credentials
$gscf = new GSCF();
$gscf->cachePath('/tmp');
$gscf->url('http://studies.mydomain.com');
// set this with the main GSCF URL
$gscf->username('');
// set this with the username
$gscf->password('');
// set this with the password
$gscf->apiKey('');
// set this with the api key for this user
// fetch all readable studies
$studies = $gscf->getStudies();
printf("%d studies\n", count($studies));
// iterate through studies
foreach ($studies as $study) {
    printf("Study\t: %s\n", $study->title);