Exemple #1
0
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package   APF-1.6
 * @version   1.1
 * @since     File available since 1.0
 * @author    Florian TEISSIER <*****@*****.**>
 * @copyright Copyright (c) 2015 by Teicorp. All rights reserved.
 */
try {
    if (!file_exists(SITE_ROOT . DS . 'Src' . DS . 'Controller' . DS . ($route->path('prefix') ? $route->path('prefix') . DS : '') . $route->path('main') . 'Controller.php')) {
        $site = new \Vendor\Core\CoreSite($config, $route->path('all'));
        $site->bddCnx();
        $site->execute(false);
    } else {
        $site = new $controller($config, $route->path('all'));
        $site->bddCnx();
        $site->execute();
    }
} catch (\Vendor\Core\CoreCNXException $e) {
    $site->renderCNXError("Une erreur est c'est produite pendant la connexion à la base de donnée");
    if (DEBUG) {
        debug($e, 'connexion bdd');
    }
}
Exemple #2
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package   APF-1.6
 * @version   1.3
 * @since     File available since 1.0
 * @author    Florian TEISSIER <*****@*****.**>
 * @copyright Copyright (c) 2015 by Teicorp. All rights reserved.
 */
$initial = array('status' => 'ko', 'error' => '');
try {
    if (!file_exists(SITE_ROOT . DS . 'Src' . DS . 'Service' . DS . ($route->path('prefix') ? $route->path('prefix') . DS : '') . $route->path('main') . 'Service.php')) {
        $site = new \Vendor\Core\CoreSite($config, $route->path('all'));
        $site->bddCnx();
        $result = $site->serviceExecute(false);
    } else {
        $site = new $service($config, $route->path('all'));
        $site->bddCnx();
        $result = $site->serviceExecute();
    }
} catch (\Vendor\Core\CoreCNXException $e) {
    $result['error'] = "une erreur c'est produite pendant la connexion à la base de données";
}
// Recherche error pour modification initial
if (!isset($result['error'])) {
    $initial['status'] = 'ok';
}
// Fusion réponse avec initial.