Exemple #1
0
 /**
  * _runTool() - This is where the magic happens, dispatch Zend_Tool
  *
  * @return void
  */
 protected function _runTool()
 {
     $configOptions = array();
     if (isset($this->_configFile) && $this->_configFile) {
         $configOptions['configOptions']['configFilepath'] = $this->_configFile;
     }
     if (isset($this->_storageDirectory) && $this->_storageDirectory) {
         $configOptions['storageOptions']['directory'] = $this->_storageDirectory;
     }
     // ensure that zf.php loads the Zend_Tool_Project features
     $configOptions['classesToLoad'] = 'Zend\\Tool\\Project\\Provider\\Manifest';
     $autoloader = new Zend\Loader\StandardAutoloader();
     $autoloader->setFallbackAutoloader(true);
     $autoloader->register();
     $console = new Zend\Tool\Framework\Client\Console\Console($configOptions);
     $console->dispatch();
     return null;
 }
 * License, or (at your option) any later version.
 *
 * SOGoAccountsManager 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with SOGoAccountsManager.  If not, see <http://www.gnu.org/licenses/>.
 */
set_include_path(ini_get('include_path') . PATH_SEPARATOR . dirname(dirname(__FILE__)) . '/library' . PATH_SEPARATOR . dirname(dirname(__FILE__)) . '/application');
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
require 'Zend/Loader/StandardAutoloader.php';
$zendAutoloader = new \Zend\Loader\StandardAutoloader();
$zendAutoloader->setFallbackAutoloader(true);
$zendAutoloader->register();
$app = new \Slim\Slim();
$app->config(include 'config.php');
$app->add(new \Slim\Middleware\ContentTypes());
$app->add(new \SOGoAccountsManager\Middleware\SOGoSession());
$app->add(new \SOGoAccountsManager\Middleware\SOGoConfiguration());
$app->add(new \SOGoAccountsManager\Middleware\JsonExceptions());
$app->get('/checkAuth', function () use($app) {
    $className = '\\SOGoAccountsManager\\Authentication';
    $auth = new $className($app);
    $auth->check();
});
// Accounts routes
$app->get('/accounts', function () use($app) {
    $className = $app->config('informationsStore.namespace') . '\\Accounts';