Browse Source

update to symfony 2.0.5

Igor Wiedler 13 years ago
parent
commit
93357a582f
7 changed files with 80 additions and 61 deletions
  1. 1 1
      .gitignore
  2. 1 1
      app/config/config.yml
  3. 0 18
      app/config/parameters.ini.dist
  4. 15 0
      app/config/parameters.yml.dist
  5. 49 27
      bin/vendors
  6. 7 7
      deps
  7. 7 7
      deps.lock

+ 1 - 1
.gitignore

@@ -1,5 +1,5 @@
 web/bundles/
-app/config/parameters.ini
+app/config/parameters.yml
 app/bootstrap*
 app/cache/*
 app/logs/*

+ 1 - 1
app/config/config.yml

@@ -1,5 +1,5 @@
 imports:
-    - { resource: parameters.ini }
+    - { resource: parameters.yml }
     - { resource: security.yml }
 
 framework:

+ 0 - 18
app/config/parameters.ini.dist

@@ -1,18 +0,0 @@
-; These parameters can be imported into other config files
-; by enclosing the key with % (like %database_user%)
-; Comments start with ';', as in php.ini
-[parameters]
-    database_driver   = pdo_mysql
-    database_host     = localhost
-    database_name     = packagist
-    database_user     = root
-    database_password =
-
-    mailer_transport  = smtp
-    mailer_host       = localhost
-    mailer_user       =
-    mailer_password   =
-
-    locale            = en
-
-    secret            = CHANGE_ME_IN_PROD

+ 15 - 0
app/config/parameters.yml.dist

@@ -0,0 +1,15 @@
+parameters:
+    database_driver: pdo_mysql
+    database_host: localhost
+    database_name: packagist
+    database_user: root
+    database_password:
+
+    mailer_transport:
+    mailer_host: localhost
+    mailer_user:
+    mailer_password:
+
+    locale: en
+
+    secret: CHANGE_ME_IN_PROD

+ 49 - 27
bin/vendors

@@ -10,6 +10,8 @@
  * file that was distributed with this source code.
  */
 
+set_time_limit(0);
+
 $rootDir = dirname(__DIR__);
 $vendorDir = $rootDir.'/vendor';
 
@@ -22,22 +24,33 @@ Specify a command to run:
 
  install: install vendors as specified in deps or deps.lock (recommended)
  update:  update vendors to their latest versions (as specified in deps)
-
+ lock:  lock vendors to their current versions
 
 EOF
     );
 }
 
-if (!in_array($command = array_shift($argv), array('install', 'update'))) {
+if (!in_array($command = array_shift($argv), array('install', 'update', 'lock'))) {
     exit(sprintf("Command \"%s\" does not exist.\n", $command));
 }
 
-if (!is_dir($vendorDir)) {
-    mkdir($vendorDir, 0777, true);
+/*
+ * Check wether this project is based on the Standard Edition that was
+ * shipped with vendors or not.
+ */
+if (is_dir($vendorDir.'/symfony') && !is_dir($vendorDir.'/symfony/.git') && !in_array('--reinstall', $argv)) {
+    exit(<<<EOF
+Your project seems to be based on a Standard Edition that includes vendors.
+
+Try to run ./bin/vendors install --reinstall
+
+
+EOF
+    );
 }
 
-if (!file_exists($rootDir.'/app/config/parameters.ini')) {
-    copy($rootDir.'/app/config/parameters.ini.dist', $rootDir.'/app/config/parameters.ini');
+if (!is_dir($vendorDir)) {
+    mkdir($vendorDir, 0777, true);
 }
 
 // versions
@@ -54,39 +67,46 @@ if ('install' === $command && file_exists($rootDir.'/deps.lock')) {
 
 $newversions = array();
 $deps = parse_ini_file($rootDir.'/deps', true, INI_SCANNER_RAW);
+if (false === $deps) {
+    exit("The deps file is not valid ini syntax. Perhaps missing a trailing newline?\n");
+}
 foreach ($deps as $name => $dep) {
-    // revision
-    if (isset($versions[$name])) {
-        $rev = $versions[$name];
-    } else {
-        $rev = isset($dep['version']) ? $dep['version'] : 'origin/HEAD';
-    }
+    $dep = array_map('trim', $dep);
 
     // install dir
     $installDir = isset($dep['target']) ? $vendorDir.'/'.$dep['target'] : $vendorDir.'/'.$name;
     if (in_array('--reinstall', $argv)) {
-        if (PHP_OS == 'WINNT') {
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
             system(sprintf('rmdir /S /Q %s', escapeshellarg(realpath($installDir))));
         } else {
             system(sprintf('rm -rf %s', escapeshellarg($installDir)));
         }
     }
 
-    echo "> Installing/Updating $name\n";
+    if ('install' === $command || 'update' === $command) {
+        echo "> Installing/Updating $name\n";
 
-    // url
-    if (!isset($dep['git'])) {
-        exit(sprintf('The "git" value for the "%s" dependency must be set.', $name));
-    }
-    $url = $dep['git'];
+        // url
+        if (!isset($dep['git'])) {
+            exit(sprintf('The "git" value for the "%s" dependency must be set.', $name));
+        }
+        $url = $dep['git'];
 
-    if (!is_dir($installDir)) {
-        system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
-    }
+        if (!is_dir($installDir)) {
+            system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
+        }
+
+        // revision
+        if (isset($versions[$name])) {
+            $rev = $versions[$name];
+        } else {
+            $rev = isset($dep['version']) ? $dep['version'] : 'origin/HEAD';
+        }
 
-    system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+        system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+    }
 
-    if ('update' === $command) {
+    if ('update' === $command || 'lock' === $command) {
         ob_start();
         system(sprintf('cd %s && git log -n 1 --format=%%H', escapeshellarg($installDir)));
         $newversions[] = trim($name.' '.ob_get_clean());
@@ -94,15 +114,17 @@ foreach ($deps as $name => $dep) {
 }
 
 // update?
-if ('update' === $command) {
+if ('update' === $command || 'lock' === $command) {
+    echo "> Updating deps.lock\n";
+
     file_put_contents($rootDir.'/deps.lock', implode("\n", $newversions));
 }
 
 // php on windows can't use the shebang line from system()
-$interpreter = PHP_OS == 'WINNT' ? 'php.exe' : '';
+$interpreter = defined('PHP_WINDOWS_VERSION_BUILD') ? 'php.exe' : '';
 
 // Update the bootstrap files
-system(sprintf('%s %s', $interpreter, escapeshellarg($rootDir.'/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php')));
+system(sprintf('%s %s %s', $interpreter, escapeshellarg($rootDir.'/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php'), escapeshellarg($rootDir)));
 
 // Update assets
 system(sprintf('%s %s assets:install %s', $interpreter, escapeshellarg($rootDir.'/app/console'), escapeshellarg($rootDir.'/web/')));

+ 7 - 7
deps

@@ -1,30 +1,30 @@
 [symfony]
     git=http://github.com/symfony/symfony.git
-    version=v2.0.4
+    version=origin/2.0
 
 [twig]
     git=http://github.com/fabpot/Twig.git
-    version=v1.3.0
+    version=v1.1.2
 
 [monolog]
     git=http://github.com/Seldaek/monolog.git
-    version=1.0.1
+    version=1.0.2
 
 [doctrine-common]
     git=http://github.com/doctrine/common.git
-    version=2.1.2
+    version=origin/2.1.x
 
 [doctrine-dbal]
     git=http://github.com/doctrine/dbal.git
-    version=2.1.3
+    version=origin/2.1.x
 
 [doctrine]
     git=http://github.com/doctrine/doctrine2.git
-    version=2.1.2
+    version=origin/2.1.x
 
 [swiftmailer]
     git=http://github.com/swiftmailer/swiftmailer.git
-    version=v4.1.2
+    version=v4.1.3
 
 [assetic]
     git=http://github.com/kriswallsmith/assetic.git

+ 7 - 7
deps.lock

@@ -1,10 +1,10 @@
-symfony 1f2e72d84aa9a4829185d6b2a0b814f6b933b30a
-twig 4b929992df65808f36e8f93f87fa66a9fce03629
-monolog 303b8a83c87d5c6d749926cf02620465a5dcd0f2
-doctrine-common b385ca770888248241bd3086a40d5b3bd082a706
-doctrine-dbal e0b69790ab1ffd646fd70a04fdb91e5dfbb3ccf1
-doctrine 144d0de0ab61dffc738d7fb590cff8d77919f553
-swiftmailer 8c3165691e36302405926abbae7526549db8b899
+symfony 7f21a5e9792f892166a550bb55791d80248243fc
+twig 396435ecd05556adb0a8bd05b14641cb4f8a8aa5
+monolog b704c49a3051536f67f2d39f13568f74615b9922
+doctrine-common e4a48faef35752ba3cd1d261316313e9c09e0c81
+doctrine-dbal f80444b8a476e5e6748239b68246528afc14f3f0
+doctrine d9328ea5e70d0d0f9d5578c47dfe152778d4b9ae
+swiftmailer daaff2b8515390fbb10882647311f476b89a67e6
 assetic f829ad23d23c87480151a21faad49fefe7c09e5d
 twig-extensions eba4f5d572bec05c72a47bbd73ba0a3330cf8f54
 metadata 8717ad2a5689480765d9ffafe925cd8a2457e582