usr bin env php php error_reporting E_ERROR Define path to application

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/env php
<?php
error_reporting ( E_ERROR );
// Define path to application directory
define ( 'FILE_DIR', realpath ( dirname ( __FILE__ ) ) );
define ( 'APPLICATION_PATH', '/usr/home/agrr/public_html/application/');
// Define application environment
defined ( 'APPLICATION_ENV' ) || define ( 'APPLICATION_ENV', (getenv ( 'APPLICATION_ENV' ) ? getenv ( 'APPLICATION_ENV' ) : 'production') );
// Ensure library/ is on include_path
set_include_path ( implode ( PATH_SEPARATOR, array (realpath ( APPLICATION_PATH . '/../library' ), get_include_path () ) ) );
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application ( );
class Payments {
function __construct() {
$config = new Zend_Config_Ini (APPLICATION_PATH. '/configs/application.ini', 'production' );
$this->db = Zend_Db::factory ( $config->resources->db );
}
function getPayments(){
$payments = new Model_Winners();
return $payments->getPayments();
}
function pay(){
Zend_Debug::dump($this->getPayments());
}
}
$pay = new Payments ( );
$pay->pay();