Posts by Fábio Lemos Elizandro • 834 points
31 posts
-
2
votes2
answers1763
viewsA: Real time ajax request
You are using a technique called pooling which is to keep asking the server from time to time if you have a new content, this in itself is already heavy and if every time your request hits the…
-
0
votes3
answers325
viewsA: Prevent the system from locking during a batch e-mail
A good solution would be to use a webservice to send the emails, you only need to put the emails in a persistent queue and the sending service would do the job without rushing and without charging…
-
2
votes2
answers339
viewsQ: CAPTCHA in stateless API
How to use CAPTCHA in a stateless application? If not, what is the alternative to this?
-
2
votes1
answer474
viewsQ: Mongodb - Large Collections of Documents
I’m developing a website where users can vote for or against places they know about. To do this I could create a collection called "votes" relating the site to the user and whether it was for or…
mongodbasked Fábio Lemos Elizandro 834 -
2
votes3
answers739
viewsA: __autoload PHP function does not open subfolders
If you no longer want to have problems with this type of situation I recommend using an Autoloader ready. My tip is to use the Composer, for this you have to install the same. Installing the…
phpanswered Fábio Lemos Elizandro 834 -
2
votes1
answer125
viewsQ: Working with javascript environments using Grunt
I have a very bad problem in my web projects, I don’t work with environments, I wanted my application to have different configuration types according to the environment, for example: in the DEV…
-
2
votes2
answers664
viewsA: Redirection: Location vs Refresh
To discover the difference we will have to analyze this question from two points of view, server-side and client-side: Server-side For the server there is no difference, it will simply be another…
-
0
votes1
answer196
viewsQ: Heroku task scheduler to run PHP script
I need to run a PHP script in Heroku with the task scheduler, I’m reading this article but I don’t understand. Some idea?…
-
2
votes4
answers425
viewsA: Is it not recommended to use scaffolding?
I am not against code generators, but probably you will duplicate logic in various situations, there are other ways you streamline your CRUD process by using OO with patterns like Observer, DI and…
software-engineeringanswered Fábio Lemos Elizandro 834 -
1
votes2
answers37
viewsA: Doctrine DBAL dev version
Rafael is correct, to complement I will leave an example of a Composer.json with the dependency of Dbal Doctrine { "name": "empresa/projeto", "description": "Descrição do seu projeto", "require": {…
-
2
votes1
answer82
viewsA: "Unexpected tag name" syntax error in Symfony2/Twig
Try it this way <h1>Posts</h1> {% for post in posts %} <article> <h2> {{ post.titulo }} </h2> <div class="content"> {{ post.conteudo }} </div>…
-
2
votes1
answer133
viewsA: Doctrine DBAL bank operations DB
You can use Querybuilder to facilitate the creation of Sqls, in your case would look like this: SELECT $tcorrida = $qb ->select('*') ->from('tcorrida', 'c')…
-
3
votes2
answers3709
viewsA: Crud Energy with PDO
Very sensible what you’re trying to do, but my first tip is: just do it for didactic reasons. Calm down, I already explain why, there are packages ready that do what you want and in a very good and…
-
5
votes3
answers6948
viewsA: How to crop an image to the center when uploading it
You can do this with cutting in the server slime, I use imagine has a very interesting OO approach to image manipulation. Installation Add the following dependency to your Composer.json file:…
-
3
votes2
answers274
viewsA: Force property declaration
I believe that it is not possible to do what you want, properties are inherited at most as far as I know. But it is possible to solve this without the need to define a property, you can leave a…
-
8
votes6
answers1673
viewsA: Big job or small job?
The important thing is the method do only one thing and only one, it decreases the complexity and facilitates tests and maintenance. Example: public function salvar(){ //salva seu modelo //lógica…
-
7
votes7
answers367
viewsA: Is there a problem if I leave a php file containing only HTML code?
This in itself does not leave you vulnerable, but if it is a static file you can leave it static, it only makes sense to leave PHP together with HTML when you need to render HTML on the server.…
-
5
votes7
answers1478
viewsA: Is using many interfaces a bad programming practice?
To answer your question: It is not bad practice. But you should follow some principles when doing the modeling, according to the principle YAGNI you do not need to create interfaces for all your…
-
4
votes3
answers241
viewsA: Hosting php website
It is probably problem with file system, on a linux server the file system is case sensitive in windows not. Check that the file name and path are exactly the same.
-
2
votes1
answer1080
viewsA: How to activate a user’s email registration?
I Gero a token and saved it on my user, then I search in the database the user that contains this token, so you recover the user without much work. To generate the token I use the following methods…
-
0
votes3
answers944
viewsA: PHP and Sqlserver connection
You could try using the PDO to Sqlserver <?php try { $hostname = "myhost"; $port = 10060; $dbname = "tempdb"; $username = "dbuser"; $pw = "password"; $dbh = new PDO…
-
3
votes3
answers637
viewsQ: Alternative to the Enterprise Architect
Does anyone know any tools for diagramming classes like EA? It does not need to be so complete only need class diagrams, and it would have to run in Ubuntu.
software-engineeringasked Fábio Lemos Elizandro 834 -
0
votes3
answers29719
viewsA: How to create a button(button) or a link(a) to download a particular file?
First you have to put a Hidden and src iframe in your application <iframe name="iframe_download" class="hidden"></iframe> Now you can put the download link with target to the hidden…
-
1
votes1
answer583
viewsA: Doctrine Date Format
Doctrine does not yet have the full range of SQL functions, they are working on it for future versions according to Cookbook. Until then you have to create the missing functions, in my case create…
-
0
votes1
answer583
viewsQ: Doctrine Date Format
I would like to format a date with Doctrine, often I save a date like datetime in the database but want to perform a search grouping per day without considering minutes and seconds. Does anyone know…
-
1
votes1
answer42
viewsQ: Conversion of parameters with Symfony2
Does anyone know any elegant way to convert a parameter to symfony2 Paramconverter Symfony2 but I don’t use Annotations. Some alternative ?…
-
0
votes4
answers3838
viewsA: How to run a PHP function in the background?
I think the best alternative for you is to create a daemon in php, for that you would have to have another server(worker) that can be cheap because you can manage a queue cadenciada. To accomplish…
-
0
votes2
answers890
viewsQ: Direct upload to Amazon S3
I work using Symfony 2.5, Heroku and Amazon S3 hosting for the static files. I am working on a project where the user can upload very large images, and this ends up locking the server of my app or…
-
-1
votes2
answers114
viewsA: Problem returning the size of a file with PHP and Curl
When using CURL there are many things that can go wrong, so I recommend that you use some component to perform these requests I use the Guzzle so you’ll have friendlier mistakes…
-
1
votes4
answers1083
viewsA: External connection JSON Webservice
This problem is very common on webservices I suggest you study about CORS http://pt.wikipedia.org/wiki/Cross-origin_resource_sharing. This is a problem that has to be solved both on the server and…
-
3
votes3
answers451
viewsA: PHP execution via Ajax jQuery
Assuming you want to literally create an HTTP router, this is not the best way to do it. In addition to not being good for the quality of the code, it is not possible to test and end the sanity of…