Comments (6)
Very good point. Thank you for the heads up!
On Mar 20, 2013, at 8:01 AM, woru [email protected] wrote:
Exception handlers set no exit code, which causes problems when migrations are called from bash scripts.
Fix:
Index: ruckusing-migrations/lib/Ruckusing/Exception.php
--- ruckusing-migrations/lib/Ruckusing/Exception.php (revision 6344)
+++ ruckusing-migrations/lib/Ruckusing/Exception.php (working copy)
@@ -79,6 +79,7 @@
public static function errorHandler($code, $message, $file, $line)
{
file_put_contents('php://stderr', "\n" . basename($file) . "({$line}) : {$message}\n\n");
die(1);
}
/**
@@ -89,6 +90,7 @@
public static function exceptionHandler($exception)
{
file_put_contents('php://stderr', "\n" . basename($exception->getFile()) . "({$exception->getLine()}) : {$exception->getMessage()}\n\n");die(1);
}
}
—
Reply to this email directly or view it on GitHub.
from ruckusing-migrations.
Please what was this trying to fix exactly ? can we have a way to reproduce this ? This changes introduces #96 .
Thanks
from ruckusing-migrations.
- env: linux
- create a migration
- in the up method add an invalid sql e.g. $this->execute("drop table dssdsdsdsd");
- create a bash script or run in the command line: php ruckus.php db:migrate && echo "success"
'success' is displayed even though migrations failed
from ruckusing-migrations.
Here is a sample code I tested with pure php
salimane at salimane-zenbook in ~
⚛ cat a.php
<?php
echo a;
salimane at salimane-zenbook in ~
⚛ php a.php
Notice: Use of undefined constant a - assumed 'a' in /home/salimane/a.php on line 3
Call Stack:
0.0226 373800 1. {main}() /home/salimane/a.php:0
PHP Notice: Use of undefined constant a - assumed 'a' in /home/salimane/a.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/salimane/a.php:0
salimane at salimane-zenbook in ~
⚛ php a.php && echo "success"
Notice: Use of undefined constant a - assumed 'a' in /home/salimane/a.php on line 3
Call Stack:
0.0228 373800 1. {main}() /home/salimane/a.php:0
PHP Notice: Use of undefined constant a - assumed 'a' in /home/salimane/a.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/salimane/a.php:0
success
salimane at salimane-zenbook in ~
⚛
Pure php is also showing that behavior.
Thanks
from ruckusing-migrations.
You example is invalid. Undefined variable results in a notice not error so result code 'success' is acceptable.
Try:
a.php:
from ruckusing-migrations.
please could you send a pull request..
Thanks
from ruckusing-migrations.
Related Issues (20)
- Run migration through code HOT 1
- db:migrate throws exception if migrations dir is not writable HOT 3
- migrate_from_offset issue HOT 1
- Unable to execute query for trigger HOT 10
- DB connection issue when trying to setup Ruckusing Migrations - Abstract.php No Such File Or Directory HOT 4
- Error during migrations and rollbacks. "Reason: Commands out of sync; you can't run this command now" HOT 3
- Is it possible to execute the ruckusing-migration through http request HOT 4
- Is there any plan to have more details in schema_migrations table? HOT 1
- MySQL timestamp needs a NULL attribute when null == true
- how can i add auto_increment column to work with mysql and postgres databases? HOT 5
- FOREIGN KEY Constraint HOT 1
- Exception not properly thrown HOT 1
- Documentation for config file HOT 1
- CREATE INDEX CONCURRENTLY cannot run inside a transaction block
- Fatal error: Class 'mysqli' not found in /web/vendor/ruckusing/ruckusing-migrations/lib/Ruckusing/Adapter/MySQL/Base.php on line 1259 HOT 3
- Error:I dont know what column type of 'longtext' maps to for MySQL
- Roadmap: Integrate Percona Toolkit? HOT 1
- Use PSR LoggerInterface instead of Ruckusing_Util_Logger.
- Unable to connect via TLS for MySQL connections
- too many connections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruckusing-migrations.