Exemple #1
0
 * 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 'PAGI/Autoloader/Autoloader.php';
// Include PAGI autoloader.
\PAGI\Autoloader\Autoloader::register();
// Call autoloader register for PAGI autoloader.
use PAGI\Application\Exception\InvalidApplicationException;
use PAGI\Application\PAGIApplication;
$appName = getenv('PAGIApplication');
$bootstrap = getenv('PAGIBootstrap');
$log4php = realpath(getenv('log4php_properties'));
$myApp = '';
try {
    include_once $bootstrap;
    if (!class_exists($appName, true)) {
        throw new \Exception($appName . ' is not loaded');
    }
    $rClass = new ReflectionClass($appName);
    if (!$rClass->isSubclassOf('PAGI\\Application\\PAGIApplication')) {
        throw new \Exception($appName . ': Invalid application');
    }
    $agi = PAGI\Client\Impl\ClientImpl::getInstance(array('log4php.properties' => $log4php));
    $myApp = new $appName(array('pagiClient' => $agi));
    $myApp->init();
    $myApp->run();
} catch (\Exception $e) {
    $myApp->log($e);
}
Exemple #2
0
 *
 *     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.
 *
 */
use PAGI\Application\Exception\InvalidApplicationException;
use PAGI\Application\PAGIApplication;
$appName = getenv('PAGIApplication');
$bootstrap = getenv('PAGIBootstrap');
$myApp = '';
try {
    include_once $bootstrap;
    if (!class_exists($appName, true)) {
        throw new \Exception($appName . ' is not loaded');
    }
    $rClass = new ReflectionClass($appName);
    if (!$rClass->isSubclassOf('PAGI\\Application\\PAGIApplication')) {
        throw new \Exception($appName . ': Invalid application');
    }
    $agi = PAGI\Client\Impl\ClientImpl::getInstance();
    $myApp = new $appName(array('pagiClient' => $agi));
    $myApp->init();
    $myApp->run();
} catch (\Exception $e) {
    $myApp->log($e);
}