diff options
| author | polo-pc-greta <ordipolo@gmx.fr> | 2025-03-27 10:13:03 +0100 |
|---|---|---|
| committer | polo-pc-greta <ordipolo@gmx.fr> | 2025-03-27 10:13:03 +0100 |
| commit | df3612ed7e6691530503f79483d2fdbc032d01b8 (patch) | |
| tree | 56d1c68fdc8625f5dad1937a654299d45142c79a /bin | |
| download | cms-df3612ed7e6691530503f79483d2fdbc032d01b8.tar.gz cms-df3612ed7e6691530503f79483d2fdbc032d01b8.tar.bz2 cms-df3612ed7e6691530503f79483d2fdbc032d01b8.zip | |
mise en ligne github
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/copy_directory.php | 25 | ||||
| -rw-r--r-- | bin/doctrine | 18 |
2 files changed, 43 insertions, 0 deletions
diff --git a/bin/copy_directory.php b/bin/copy_directory.php new file mode 100644 index 0000000..2c001c0 --- /dev/null +++ b/bin/copy_directory.php | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | <?php | ||
| 2 | // bin/copy_directory.php | ||
| 3 | // | ||
| 4 | // appel dans le composer.json | ||
| 5 | |||
| 6 | function copyDirectory($source, $destination) { | ||
| 7 | if (!is_dir($destination)) { | ||
| 8 | mkdir($destination, 0777, true); | ||
| 9 | } | ||
| 10 | |||
| 11 | $iterator = new RecursiveIteratorIterator( | ||
| 12 | new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), | ||
| 13 | RecursiveIteratorIterator::SELF_FIRST | ||
| 14 | ); | ||
| 15 | |||
| 16 | foreach ($iterator as $item) { | ||
| 17 | if ($item->isDir()) { | ||
| 18 | mkdir($destination . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); | ||
| 19 | } else { | ||
| 20 | copy($item, $destination . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | copyDirectory($argv[1], $argv[2]); | ||
diff --git a/bin/doctrine b/bin/doctrine new file mode 100644 index 0000000..8017267 --- /dev/null +++ b/bin/doctrine | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #!/usr/bin/env php | ||
| 2 | <?php | ||
| 3 | // bin/doctrine | ||
| 4 | |||
| 5 | use Doctrine\ORM\Tools\Console\ConsoleRunner; | ||
| 6 | use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider; | ||
| 7 | |||
| 8 | chdir('bin'); // pour être au même niveau que l'appli dans /public | ||
| 9 | |||
| 10 | require('../src/Config.php'); | ||
| 11 | Config::load('../config/config.ini'); | ||
| 12 | |||
| 13 | require '../src/model/doctrine-bootstrap.php'; // relatif | ||
| 14 | //require __DIR__ . '/../src/model/doctrine-bootstrap.php'; // absolu | ||
| 15 | |||
| 16 | ConsoleRunner::run( | ||
| 17 | new SingleManagerProvider($entityManager) | ||
| 18 | ); | ||
