tag:blogger.com,1999:blog-30693223993918107842024-03-13T04:24:53.260-07:00SAKRA WebStudioLaszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.comBlogger141125tag:blogger.com,1999:blog-3069322399391810784.post-9787592168177662572013-01-30T23:39:00.000-08:002013-01-31T00:07:00.701-08:00PDO MySQL<pre class="php" name="code">
try {
$this->_handle = new PDO('mysql:host=localhost;dbname='.$db, self::$username, self::$password);
$this->_handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->_handle->query('SET NAMES UTF8');
} catch(Exception $e) {
echo $e->getMessage();
}
</pre>
set error mode another way
<pre class="php" name="code">
$dbh = new PDO($dsn, $user, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
</pre>
set 'set names utf8' another way:
<pre class="php" name="code">
$db = new PDO('mysql:host=localhost;dbname=something', 'username', 'password', array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
</pre>
closing the connection, if you want, not needed
<pre class="php" name="code">
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
// use the connection here
// and now we're done; close it
$dbh = null;
</pre>
prepared statement, binding with bindParam
<pre class="php" name="code">
$stmt = $this->db->prepare('SELECT * FROM '.$this->table.' WHERE '.$this->primary_key.' = :id AND domain IN '.$domains);
$stmt->bindParam(':id', $id);
$stmt->execute();
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
if(count($row) == 1) {
</pre>
binding with execute:
<pre class="php" name="code">
$pre = $this->db->prepare('INSERT INTO '.$this->table.' ('.implode(', ', array_keys($fields)).') VALUES ('.$question_marks.')');
$pre->execute(array_values($fields));
</pre>
key-pair fetch:
<pre class="php" name="code">
$items = $this->db->query('SELECT '.$this->primary_key.', '.$this->name_field.' FROM '.$this->table.' WHERE domain IN '.$domains.' ORDER BY '.$this->name_field)->fetchAll(PDO::FETCH_KEY_PAIR);
</pre>
fetch with query and fetch:
<pre class="php" name="code">
$packages = $db->query('SELECT * FROM package_translation');
foreach($packages as $package) {
echo $package['name'].'<br />';
}
$stmt = $db->query('SELECT * FROM package_translation');
$result = $stmt->setFetchMode(PDO::FETCH_NUM);
while ($row = $stmt->fetch()) {
print $row[0] . "\t" . $row[1] . "\t" . $row[2] . "\n";
}
</pre>
affected rows (insert, update, delete):
<pre class="php" name="code">
/* Delete all rows from the FRUIT table */
$del = $dbh->prepare('DELETE FROM fruit');
$del->execute();
/* Return number of rows that were deleted */
print("Return number of rows that were deleted:\n");
$count = $del->rowCount();
print("Deleted $count rows.\n");
</pre>
count rows:
<pre class="php" name="code">
$sql = "SELECT COUNT(*) FROM package_translation";
if ($res = $db->query($sql)) {
/* Check the number of rows that match the SELECT statement */
if ($res->fetchColumn() > 0) {
/* Issue the real SELECT statement and work with the results */
$sql = "SELECT * FROM package_translation";
foreach ($db->query($sql) as $row) {
print "Name: " . $row['name'] . "\n";
}
}
/* No rows matched -- do something else */
else {
print "No rows matched the query.";
}
}
$res = null;
$conn = null;
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-72482126249231952872013-01-30T23:14:00.000-08:002013-01-30T23:14:10.208-08:00SPL Autoloader<pre class="php" name="code">
class Autoloader {
public static function autoload($classname) {
if(file_exists('../lib/'.$classname . '.class.php')) {
include_once($classname . '.class.php');
} else {
include_once('../lib/model/'.$classname . '.class.php');
}
if (!class_exists($classname)) {
throw new MyException("Class '$classname' not found", 7);
}
}
}
spl_autoload_register(array('Autoloader', 'autoload'));
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-20899818546575967322013-01-17T03:25:00.002-08:002013-01-17T03:25:35.978-08:00Copy MySQL Database to Another Database<span style="background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px;">mysqldump -h [server] -u [user] -p[password] db1 | mysql -h [server] -u [user] -p[password] db2</span>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-59980676309171310152012-12-10T04:15:00.000-08:002012-12-10T04:15:00.871-08:00Reload Cached CSS / JS Files in SymfonyAn elegant way to force browsers to reload cached CSS / JS files in Symfony 1.4<br />
<br />
<span style="font-size: large;">settings.yml</span><br />
Add <b>Asset, CSSCache, JSCache</b> to the <b>standard_helpers</b> row:<br />
<pre class="php" name="code">standard_helpers: [ Partial, Cache, I18N, Date, Asset, CSSCache, JSCache ]
</pre>
<span style="font-size: large;">lib/helper/CSSCacheHelper.php</span>
<br />
<pre class="php" name="code">function include_versioned_stylesheets()
{
$response = sfContext::getInstance()->getResponse();
sfConfig::set('symfony.asset.stylesheets_included', true);
$html = '';
foreach ($response->getStylesheets() as $file => $options) {
$filepath = sfConfig::get('sf_web_dir') . '/' . stylesheet_path($file);
if(file_exists($filepath)) {
$file .= '?v=' . filectime($filepath);
}
$html .= stylesheet_tag($file, $options);
}
echo $html;
}
</pre>
<span style="font-size: large;">lib/helper/JSCacheHelper.php
</span><br />
<pre class="php" name="code">function include_versioned_javascripts()
{
$response = sfContext::getInstance()->getResponse();
sfConfig::set('symfony.asset.javascripts_included', true);
$html = '';
foreach ($response->getJavascripts() as $file => $options) {
$filepath = sfConfig::get('sf_web_dir') . '/' . javascript_path($file);
if(file_exists($filepath)) {
$file .= '?v=' . filectime($filepath);
}
$html .= javascript_include_tag($file, $options);
}
echo $html;
}
</pre>
<span style="font-size: large;">apps/xxx/templates/layout.php</span><br />
Use the include_versioned_stylesheets() and include_versioned_javascripts() functions to load css and js files, instead of the default include_stylesheets() and include_javascripts() functions.</app>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-10862192991708635082012-12-04T06:10:00.001-08:002012-12-04T06:11:18.353-08:00Display Image with Original Size in TCPDF$pdf->setImageScale(1.53); makes an ability to display pictures in original dimensions, with no blur. Also beware to call setImageScale() before AddPage:<br />
<pre class="php" name="code">$pdf->setImageScale(1.53);
$pdf->AddPage();
</pre>
Source: <a href="http://sourceforge.net/p/tcpdf/discussion/435311/thread/404343d4">http://sourceforge.net/p/tcpdf/discussion/435311/thread/404343d4</a>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com2tag:blogger.com,1999:blog-3069322399391810784.post-35782679685047615362012-12-03T05:12:00.003-08:002012-12-03T05:13:01.152-08:00Enable CKFinder in CKEditor<pre class="js" name="code">
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace( 'editor',
{
filebrowserBrowseUrl : '/ckfinder/ckfinder.html',
filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl : '/ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
});
//]]>
</script>
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com1tag:blogger.com,1999:blog-3069322399391810784.post-16597404812106824262012-11-28T07:17:00.001-08:002012-11-28T07:17:36.109-08:00Format Date in Admin Generator in SymfonyFor example, on the index/list page...
<pre class="php" name="code">
config:
actions: ~
fields: ~
list:
display: [_id, Partner, name, valid_from, valid_to]
fields:
valid_from: { date_format: yyyy-MM-dd }
valid_to: { date_format: yyyy-MM-dd }
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com1tag:blogger.com,1999:blog-3069322399391810784.post-69687751427462965702012-11-16T04:01:00.000-08:002012-11-16T04:01:07.913-08:00Add AJAX Request to Google AnalyticsIf you use jQuery you can bind to the global AjaxComplete event to fire a Pageview everytime an Ajax call completes:<br />
<pre class="javascript" name="code">jQuery(document).ajaxComplete(function(e, xhr, settings){
var d = document.location.pathname + document.location.search + document.location.hash;
_gaq.push(['_trackPageview', d]);
});
</pre>
Source: <a href="http://stackoverflow.com/questions/7737549/google-analytics-and-loading-a-page-using-ajax-get-request">http://stackoverflow.com/questions/7737549/google-analytics-and-loading-a-page-using-ajax-get-request</a>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-46253142506647601292012-10-28T10:20:00.001-07:002012-10-28T10:20:34.347-07:00FreeTDS Output Parameter Not Return to PHPI had a stored procedure that returned with the output parameter (I found it in the FreeTDS log file) but the variable of the output parameter was blank in PHP.
I checked the stored procedure and I found a stupid 'select @foo' selection in the procedure, before the initialization of the output parameter (set @output='bar').
I commented the selection (--select @foo) and now it works like a charm, the value of ouput parameter is available in the output PHP variable.
I hope this helps you.Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-6450182524574198512012-10-16T00:48:00.003-07:002012-10-16T00:48:36.993-07:00Native SQL Query in DoctrineExamples...
<pre class="php" name="code">
// get Doctrine_Connection object
$con = Doctrine_Manager::getInstance()->connection();
// execute SQL query, receive Doctrine_Connection_Statement
$st = $con->execute("...............");
// fetch query result
$result = $st->fetchAll();
</pre>
Or with parameter...
<pre class="php" name="code">
$db = Doctrine_Manager::getInstance()->connection();
$query = $db->prepare("INSERT INTO search_term (term, counter) VALUES (:term, '1') ON DUPLICATE KEY UPDATE counter=counter+1;");
$query->execute(array('term' => $search));
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-19387012559074975562012-10-16T00:45:00.002-07:002012-10-16T00:45:42.365-07:00mb_ucfirst<pre class="php" name="code">
function mb_ucfirst($string, $encoding)
{
$strlen = mb_strlen($string, $encoding);
$firstChar = mb_substr($string, 0, 1, $encoding);
$then = mb_substr($string, 1, $strlen - 1, $encoding);
return mb_strtoupper($firstChar, $encoding) . $then;
}
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-43526924178537133752012-09-25T02:04:00.000-07:002012-09-25T02:04:26.443-07:00Do Not Save Null Values in Embedded Form in SymfonyThink there is a <b>Product</b> object with many <b>ProductPrice</b> objects. The <b>Product</b> form contains some <b>ProductPrice</b> forms as embed forms. Prices are not mandatory fields. Now if you save the form, there will be null price rows in the <b>ProductPrice</b> table. Do the following in the ProductPrice <b>model(!) </b>class!<br />
<pre class="php" name="code"> public function save(Doctrine_Connection $conn = null)
{
if($this->price > 0)
{
return parent::save();
}
else
{
$this->delete();
return null;
}
}
</pre>
This will check the price (there is a price field in the ProductPrice table) is greater than 0 or not. If greater, it will save to the database. If not, it will delete the row in the table (if presents) and stop the saving process for this price object.Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-23630399424082312062012-09-25T00:45:00.000-07:002012-09-25T00:46:23.018-07:00Doctrine: SQLSTATE[23000]: Integrity constraint violation duplicate entryIf you are using a table where some fields are I18N and ex. the<b> title</b> field is sluggable, you will realize that you cannot <b>update(!) </b>the object with the same title. See an example:<br />
<br />
The page is multilingual (Hungarian and English). You create a product with <i><b>TEFAL XY</b></i> Hungarian and <i><b>TEFAL XY</b></i> English tilte (the same title used in each language). You can saved the form / object, it created successfully. Now you change the Hungarian title to TEFAL X. Save. Then change the English title to TEFAL X, too. You will get an error:<br />
<br />
<b><span style="font-size: large;">Doctrine: SQLSTATE[23000]: Integrity constraint violation duplicate entry</span></b><br />
<b><span style="font-size: large;"><br /></span></b>
This is a bug in doctrine 1.2.x.<br />
<div>
<br /></div>
<div>
<span style="font-size: large;"><b>Solution</b></span></div>
<div>
<ol>
<li>Copy <b>lib / vendor / symfony / lib / plugins / sfDoctrinePlugin / lib / vendor / doctrine / Doctrine / Template / Listener / Sluggable.php</b> inside your own lib directory.</li>
<li>In the getUniqueSlug method, change this line:<br /><b>$whereString .= ' AND r.' . implode(' != ? AND r.', $table->getIdentifierColumnNames()) . ' != ?';</b><br />to this:<br /><b>$whereString .= ' AND (r.' . implode(' != ? OR r.', $table->getIdentifierColumnNames()) . ' != ?)';</b></li>
<li>Save. Clear cache. Be happy.</li>
</ol>
<div>
Source:<br /><a href="http://www.doctrine-project.org/jira/browse/DC-728?focusedCommentId=14532&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14532">http://www.doctrine-project.org/jira/browse/DC-728?focusedCommentId=14532&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14532</a>
</div>
</div>
Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-7039677338732795762012-09-24T07:50:00.003-07:002012-09-24T07:50:57.882-07:00Hide Errors at Top of the Embed Form in SymfonyIf you use embed forms, you will realise that the validatation errors appear twice, once near the input fields (in the embed form) and once at top of the embed form. To solve this....<br />
<br />
I'm using the jroller plugin to generate auto admin:<br />
<br />
<b>plugins / sfAdminThemejRoller / data / generator / sfDoctrineModule / jroller / template / templates / _form_field.php</b><br />
<br />
Use this (my solution):<br />
<br />
<br />
[?php if ($form[$name]->hasError() && get_class($form[$name]) != 'sfFormFieldSchema'): ?]<br />
[?php echo $form[$name]->renderError() ?]<br />
[?php endif; ?]<br />
Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-12323456056804787562012-09-20T02:45:00.000-07:002012-09-20T02:45:54.032-07:00MySQL Tuning<ol>
<li>Optimize tables (to correct overheads)</li>
<li>Set <b>query cache size </b>bigger if <b>Qcache_lowmem_prunes</b> (on the runtime information page) is red.</li>
</ol>
Useful commands:<br />
<br />
<ul>
<li><b>Show all query cache settings:</b><br />SHOW VARIABLES LIKE '%query_cache%';</li>
<li><b>Set a bigger query cache size (256 MB) ON RUNTIME:</b><br />SET GLOBAL query_cache_size = 256000000;</li>
<li><b>Set a bigger query cache size in config (will work after mysql restart):</b><br />/etc/mysql/my.cnf<br />Search for "query_cache_size" then change...<br /><b>query_cache_size = 256M</b></li>
</ul>
Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-77298446409558223922012-09-15T12:48:00.000-07:002013-03-03T02:33:40.134-08:00Install Symfony 2 on Debian<ol>
<li>Download the Standard version and put the Symfony folder to the root.</li>
<li>Open<b> /Symfony/web/config.php</b> with browser to check the configuration. If needed, remove the ip address check from the begining of the file. I had to install things and do some changes:<br /><br /><span style="font-family: Courier New, Courier, monospace;">apt-get update<br />apt-get install php-pear php5-dev apache2-threaded-dev build-essential libicu-dev<br />pecl install apc<br />pecl install intl<br /><br />php.ini:<br />short_open_tag = Off<br />date.timezone = Europe/Budapest (for me)<br />extension = apc.so<br />extension = intl.so</span><br /><br />Save then restart apache.</li>
</ol>
<div>
<br /></div>
Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com2tag:blogger.com,1999:blog-3069322399391810784.post-52477588583483940932012-09-14T07:45:00.004-07:002012-09-14T07:45:29.262-07:00Filter Data On Frontend with Symfony Form FilterSource: <a href="http://stackoverflow.com/questions/3765495/symfony-how-to-filter-data-on-the-frontend-like-in-the-backend">http://stackoverflow.com/questions/3765495/symfony-how-to-filter-data-on-the-frontend-like-in-the-backend</a><br />
<br />
If you want to do it exactly like it is done on the backend, you can use the admin generator on frontend applications. A more general and customizable way would be to simply create list and filter actions and use Symfony's form filters. Here's a basic example for a model class "Article":<br />
<br />
In an actions class:<br />
<pre class="php" name="code">
class articleActions extends sfActions
{
public function executeList(sfWebRequest $request)
{
$this->form = new ArticleFormFilter();
$this->pager = new sfDoctrinePager('Article');
}
public function executeFilter(sfWebRequest $request)
{
$this->form = new ArticleFormFilter();
$this->form->bind($request[$this->form->getName()]);
if ($this->form->isValid())
{
$this->pager = new sfDoctrinePager('Article');
$this->pager->setQuery($this->form->getQuery());
$this->setTemplate('list');
}
//handle invalid form here
}
}
</pre>
In view, iterate throw pager like this: <br />
<pre class="php" name="code">
foreach($pager->getResults() as $article)
</pre>
Doctrine FormFilter's are fairly similar to Doctrine forms. Get started by configuring the form inside of FormFilter::configure();Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-11516976888821634552012-09-14T06:49:00.000-07:002012-09-14T06:51:19.932-07:00ob_start: PHP Output To Variable / String<pre class="php" name="code">
<?php ob_start(); ?>
Hello world, <?php echo "My Website"; ?>
<?php include('something.php') ?>
Thank you.
<?php $var = ob_get_clean(); ?>
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-73120762647232289602012-09-07T06:23:00.000-07:002012-09-07T06:23:11.539-07:00The user specified as a definer ('root'@'%') does not exist<b>Solution:</b><br />mysql -u root -p <br />grant all privileges on *.* to `root`@`%` identified by 'password'; <br />flush privileges;Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-42193527190176909262012-09-07T03:21:00.000-07:002012-09-07T04:46:50.958-07:00Install Apache 2, PHP 5, MySQL 5 on Debianapt-get update<br />
<br />
apt-get install apache2<br />
apt-get install php5<br />
apt-get install libapache2-mod-php5<br />
apt-get install mysql-server mysql-client mysql-common php5-mysql<br />
apt-get install php5-xsl php5-gd php5-curl<br />
<br />
<a href="http://sakrawebstudio.blogspot.hu/2012/05/install-newest-apc-on-debian.html" target="_blank">Install the Latest APC on Debian</a><br />
<a href="http://sakrawebstudio.blogspot.hu/2012/09/install-phpmyadmin-on-debian.html" target="_blank">Install PHPMYADMIN on Debian</a>
Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com1tag:blogger.com,1999:blog-3069322399391810784.post-11792680037388389622012-09-07T03:19:00.002-07:002012-12-12T06:07:32.260-08:00Install PHPMYADMIN on Debian1. Download the latest PHPMYADMIN.<br />
2. Put here: /usr/share/phpmyadmin<br />
3. Create phpmyadmin.conf in /etc/apache2/conf.d :<br />
<pre class="html" name="code">
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory "/usr/share/phpmyadmin">
Options Indexes FollowSymLinks
DirectoryIndex index.php
</Directory>
</pre>
4. /etc/init.d/apache2 restartLaszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-43675886009333161372012-09-06T02:23:00.000-07:002012-09-06T02:23:58.149-07:00How to Save Empty Form Fields as NULL in SymfonyIf you leave a field empty in your form, Symfony will save it as a blank value. However sometimes you want to save it as NULL...<br />
<br />
Create a method for the field in the form class:<br />
<pre class="php" name="code"> public function updateManufacturerColumn($value)
{
return (!$value) ? null : $value;
}
</pre>
Manufacturer is the name of the field now.Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-86668755317060729782012-09-06T00:52:00.004-07:002012-09-06T00:53:12.036-07:00Post Validator in Symfony<pre class="php" name="code">
public function configure()
{
$this->getValidator('day')->setOption('required', 'true');
$this->validatorSchema->setPostValidator(new sfValidatorAnd(array(
new sfValidatorCallback(array('callback' => array($this, 'checkFields'))),
)));
}
public function checkFields($validator, $values)
{
if(empty($values['manufacturer']) && empty($values['category_apollo_kod']) && empty($values['product_apollo_kod']))
{
throw new sfValidatorErrorSchema($validator, array('manufacturer' => new sfValidatorError($validator, 'custom error')));
}
return $values;
}
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-324017220955163112012-08-22T03:19:00.001-07:002012-08-22T03:19:43.271-07:00Debian: Install NTPD To Synchronism Clock With Internet Standard Time Serversdate<br />
apt-get install ntp<br />
<i>(wait....)</i><br />
date<br />
<i>(works like a charm)</i>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0tag:blogger.com,1999:blog-3069322399391810784.post-51079336653354350512012-07-11T02:47:00.000-07:002012-07-11T02:47:03.160-07:00Using Validators in Actions in SymfonyCheck whether an email address is valid or not with sfValidatorEmail:
<pre class="php" name="code">
$v = new sfValidatorEmail();
try {
$v->clean(trim($email));
} catch (sfValidatorError $e) {
// not valid
}
</pre>Laszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.com0