1. Go to this page and download the library: Download baohx2000/doc library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
baohx2000 / doc example snippets
// Default entity manager.
$em = $app['orm.em'];
use Dflydev\Pimple\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
$container = new \Pimple;
$container["db.options"] = array(
"driver" => "pdo_sqlite",
"path" => "/path/to/sqlite.db",
);
// ensure that $container['dbs'] and $container['dbs.event_manager']
// are available, most likely by way of a core service provider.
$container["orm.proxies_dir"] = "/path/to/proxies";
$container["orm.em.options"] = array(
"mappings" => array(
// Using actual filesystem paths
array(
"type" => "annotation",
"namespace" => "Foo\Entities",
"path" => __DIR__."/src/Foo/Entities",
),
array(
"type" => "xml",
"namespace" => "Bat\Entities",
"path" => __DIR__."/src/Bat/Resources/mappings",
),
// Using PSR-0 namespaceish embedded resources
// (
use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
use Silex\Application;
use Silex\Provider\DoctrineServiceProvider;
$app = new Application;
$app->register(new DoctrineServiceProvider, array(
"db.options" => array(
"driver" => "pdo_sqlite",
"path" => "/path/to/sqlite.db",
),
));
$app->register(new DoctrineOrmServiceProvider, array(
"orm.proxies_dir" => "/path/to/proxies",
"orm.em.options" => array(
"mappings" => array(
// Using actual filesystem paths
array(
"type" => "annotation",
"namespace" => "Foo\Entities",
"path" => __DIR__."/src/Foo/Entities",
),
array(
"type" => "xml",
"namespace" => "Bat\Entities",
"path" => __DIR__."/src/Bat/Resources/mappings",
),
// As of 1.1, you can also use the simplified
// XML/YAML driver (Symfony2 style)
// Mapping files can be named like Foo.orm.yml
// instead of Baz.Entities.Foo.dcm.yml
array(
"type" => "simple_yml",
"namespace" => "Baz\Entities",
"path" => __DIR__."/src/Bat/Resources/config/doctrine",
),
// Using PSR-0 namespaceish embedded resources
// (
use Dflydev\Cilex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
use Cilex\Application;
use Cilex\Provider\DoctrineServiceProvider;
$app = new Application('My Application');
$app->register(new DoctrineServiceProvider, array(
/** same as the Silex example **/
));
$app->register(new DoctrineOrmServiceProvider, array(
/** same as the Silex example **/
));