문제

I use the following code to make Propel 1.4 works in a php file.

what should i do to make sure DatabaseManager delete correctly after its work?

shutdown at the end of the php file??

what will happen if there are multiple accesses to the same php file at the same time?

<?php

require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);
$dbManager = new sfDatabaseManager($configuration);
//start db access
도움이 되었습니까?

해결책

I'm not sure I understand your question. If you want to make sure the connection is closed at the end of the script, you should not worry, since this is the default for a PDO connection (PHP will automatically close the connection when your script ends).

If multiple clients connect to your site, multiple connections to the database will be made. This is not a problem, the database will handle the concurrency.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top