Source for file Application.php
Documentation is available at Application.php
require_once 'index.php';
echo '<h3>Application</h3>';
for ($i = 1; $i < 4; $i++ ) {
$data = array ('application_define_name' => 'APP'. rand());
$appId = $admin->perm ->addApplication ($data);
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
echo 'Created Application id <strong>' . $appId . '</strong><br />';
$applications = $admin->perm ->getApplications ();
if ($applications === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($applications)) {
echo 'No applications were found, thus we\'ve halted the rest of the test<br />';
echo 'These are our current applications:';
Var_Dump ::display ($applications);
// Set/Get current Application
$admin->perm ->setCurrentApplication ($applications[$id]['application_id']);
$currentApp = $admin->perm ->getCurrentApplication ();
echo '<strong>'. $currentApp. '</strong> is our current application now.<br />';
$filters = array ('application_id' => $applications[$id]['application_id']);
$removeApp = $admin->perm ->removeApplication ($filters);
if ($removeApp === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
echo '<strong>App3</strong> was removed<br />';
unset ($applications[$id]);
$data = array ('application_define_name' => 'APP2_' . $applications[$id]['application_id'] . 'updated');
$filters = array ('application_id' => $applications[$id]['application_id']);
$updateApp = $admin->perm ->updateApplication ($data, $filters);
if ($updateApp === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
echo '<strong>App2</strong> was updated<br />';
$params = array ('filters' => array ('application_id' => $applications[$id]['application_id']));
$result = $admin->perm ->getApplications ($params);
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($result)) {
echo 'No applications were found<br />';
Var_Dump ::display ($result);
$applications = $admin->perm ->getApplications ();
if ($applications === false ) {
echo '<strong>Error on line: '.__LINE__. '</strong><br />';
} elseif (empty ($applications)) {
echo 'No applications were found<br />';
echo 'These are our current applications:';
Var_Dump ::display ($applications);
Documentation generated on Mon, 11 Mar 2019 14:16:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|