Posts by Williams • 1,314 points
41 posts
-
3
votes1
answer283
views -
2
votes1
answer347
viewsQ: What is the difference between Abstraction and Implementation?
I’d like to know the difference between Abstração and Implementação, and how this applies in practice!
-
0
votes0
answers41
viewsQ: How to recover parameters passed by the use() method, within a function?
I’m studying callbacks and I came across a method that I can’t recover and I find it even simpler to send the variables inside the function that is the operator use, but I don’t know how to get it…
-
0
votes1
answer182
viewsQ: Redirect via private method in Laravel
In the Laravel has the helpers redirect that works perfectly within public methods. However in the class I had to divide into two public and one private methods to avoid repeating the authentication…
-
2
votes1
answer268
viewsA: The Bug class doesn’t exist?
Import the Defect class in Controler with the operator use use App\Defeito; In the constructor correct the name of: public function __construct(Defei $defeitos) { $this -> defeitos = $defeitos; }…
-
3
votes1
answer80
views -
2
votes1
answer547
viewsQ: What are the shortcut keys in Phpstorm to remove Namespaces that are not in use in a Class?
What is the shortcut on phpstorm that clears the namespaces that are not in use in a class, I saw in a video class the teacher talking about a key combination and automatically cleared the…
-
1
votes0
answers36
viewsQ: Disconnect Logged-in User with Oauth Facebook, Google and Twitter
When the user asks to disconnect from my application of one of these social networks: Facebook, Google or Twitter, it is necessary to send some kind of request to API? Or I can just mark a flag as…
-
3
votes1
answer664
viewsQ: What is the correct folder permission for linux servers in production?
Reading the manual of PHP and some tutorials I was in doubt about which permission to leave in the folders after uploads of images. Some tutorials tell to leave as 0755, others as 0750, which to use…
-
4
votes1
answer192
viewsQ: What is the difference between using Arrayiterator vs Simple Array?
Some examples on the net with ArrayInterator is used in the following ways:: $arr = array("Banana", "Abacaxi", "Abacate", "Morango"); // loop through the object foreach (new ArrayIterator($arr) as…
-
0
votes1
answer69
viewsQ: How do I get PDO to list Array with Correct Types?
In Mysql save data to a table by setting some fields as int or float, but when I make a select in the database via PDO array Everything comes as a string. Has some function that forces you to return…
-
2
votes1
answer212
viewsQ: How to get the generated Array from the print_r() function to send in the email?
I’m developing a log system and need to get the data generated by print_r(), to send in the email if any error occurs in the API, this way the developers will be warned, already containing all the…
-
0
votes1
answer124
viewsQ: How do I download via Github URL or SSH
In the code json below I can only clone from the repository the dependencies of Phpmailer, if the url of the Cpanelinc/xmlapi-php are not set in repositories in the código, when if https or ssh url…
-
0
votes3
answers496
views -
5
votes1
answer2770
viewsQ: Force Urls with www. to without www. com htaccess
I would like when typing in the URL http://www.meusite.com.br o. htaccess always redirects to http://meusite.com.br, need this 4 extra characters for advertising campaigns. The opposite with .…
-
2
votes1
answer154
viewsQ: Validate Google Site Verification URL with Regex
With $_SERVER['REQUEST_URI'] I capture the following address below! /google9f7804416f93fdd6b.html I need to perform a validation with ER, the function has to recognize the word Google the parâmetros…
-
6
votes1
answer2364
viewsA: How to notify the tracking of the post office to the user?
I did the basic example for you to understand the logic, of two forms, Track do HTML and of Objetos in array for database storage, and hash for DB comparison! <?php class Tracking { public…
-
1
votes1
answer226
viewsA: How do JOIN using find()?
The way you model this Join, is from the version before 2.x. x! Correct would be this way: ... $conditions = array( 'conditions' => array( 'User.email' => $email, 'User.senha' => $senha,…
-
2
votes2
answers402
viewsQ: How to mount this multidimensional array via foreach
I’ll just put the part where I’m having trouble! The array that I need, needs to be in this format. Example 1: Array ( [atributos] => Array ( [atributo] => Array ( [nome] => Tamanho [valor]…
-
17
votes1
answer26770
viewsQ: What is XML <! [CDATA []]> for?
In some examples of platforms, has among the tags the <![CDATA []]>, but what’s it for in XML after all? Template for an XML to be followed by a platform. <?xml version="1.0"…
-
1
votes1
answer223
viewsQ: How to insert a CDATA type node in the xml generated by Cake PHP
With the code below XML in the CakePHP, however I need some nodes, have another CDATA type node. Example: <![CDATA[ Buscape Teste ]]> But I don’t know which parameter I have to pass for him to…
-
8
votes2
answers188
viewsQ: Saas System Traffic Collection
I wonder if the tráfego consumed by Search Bots, is accounted for along with users in a system SaaS. Or the charge is made only by genuine navigation via browser? Some platforms SaaS charge for…
-
8
votes1
answer50369
viewsQ: How do I get current Javascript url?
I am using jQuery. How do I get the path from the current and complete URL, I want to assign it to the variable url_atual. $("#id_ativo").change(function(){ $.ajax({ type: "POST", url: url_atual,…
-
1
votes2
answers606
viewsQ: Sort result using CASE and BETWEEN
In the first code just below, I can list the freight price of the table transport via the band cep and peso, however I am having a problem, I need to sort the result according to how cep sent,…
-
3
votes2
answers160
viewsA: How to avoid Multiple Inserts in the database
In the Unique Key function, you can put as many fields as you want to keep in the table, the row as being Única Example with more than one field UNIQUE KEY `nomeIdUnique` (`nome`,`cat`) On your…
-
5
votes1
answer944
viewsA: Calculate total cart in php
To use Api dos Correios, the best way is to assemble a function that brings only the information of the arrays, without html involved. After that, do the loop to list in checkbox the array generated…
-
3
votes3
answers2504
viewsA: include php does not work
Correct in working with OPP, is to set your settings files in a folder called Config, the directory Controller, as its name already says is to send and receive commands to the view or model. And…
-
8
votes3
answers24407
viewsQ: What is the performance difference between BIGINT and INT in Mysql?
There is some negative impact on the performance of Mysql, where the Primary Key is the type BIGINT(20), instead of INT(11)?
-
5
votes3
answers406
viewsA: Parse error: syntax error, Unexpected {
Missing close the Parentheses () and remove the tag */ closing remarks <?php session_start(); if(isset($_SESSION['user'])){ echo…
-
2
votes1
answer139
viewsA: DAO layer with two tables
Keep it simple, it’s the best thing for future maintenance of an application! If you need to make one join with another table, choose DAO it makes more sense to effect this relationship. For…
-
8
votes1
answer1345
viewsA: Namespace and PDO = Error
Just a correction in the código, place the instance of PDO inside the block try/catch try { } catch (\PDOException $e) { } Excerpt from the code private function openDatabaseConnection() { try { //…
-
2
votes0
answers151
viewsQ: Grab XML Image inside Namespace
Hello, I am days trying but unsuccessfully, get only the url of the image of xml down with javascript, XML this one that is of a feed de noticias of Wordpress, to list in another area the newest…
-
1
votes4
answers535
viewsA: Multiplying values within a for
Based on your code would look like this! $str = [50,0]; for($i=1; $i<=4; $i++) { if($i==1){ $output = $i ." "; } else { $next = array_sum($str); array_shift($str); array_push($str,$next);…
-
3
votes1
answer253
viewsA: PDO - Class Not Found
Know how to interpret the error \Presto model PDO not found, when working with namespace, each backslash is a correct directory? To use the PDO lib or native libraries you need to instantiate, use…
-
1
votes1
answer979
views -
1
votes1
answer1166
viewsA: Cakephp 3 - Inner Join
Cakephp 3.x is like this! Example: $this->Favorites ->find('all') ->leftJoin('articles', 'articles.id = Favorites.article_id'); Documentation: leftJoin(), rightJoin(), innerJoin() and…
-
1
votes1
answer231
viewsA: Modal edit cakephp
Place the codes inside the Try/catch block, to see which error is thrown by Exception public function editar($id = null) { try { //code } catch (PDOException $e) { exit('Error: '.…
-
1
votes2
answers313
viewsQ: How to set up cronjobs in cakephp?
How do I use cronjobs in Cakephp, need to call a controller action on the linux server, is the script path? I’ve tried it here and it didn’t work!
-
0
votes1
answer133
viewsQ: It’s a bug in Cakephp - Sort Aliases?
I’m trying to sort a query by relevance with cakephp using Paginator, but simply it ignores the alias, I already searched the manual but so far I haven’t found the solution, the query works…
-
0
votes2
answers3257
viewsA: Login with PHP + MYSQL +MD5
If you are using version (PHP 5 >= 5.5.0) I strongly recommend using password_hash or if < 5.5.0, use phpass.…
-
1
votes1
answer469
viewsQ: Maintain subdomain sessions with Cakephp
I’m having trouble keeping sessions active between system subdomains, I’m using Cakephp version 2.4.7, I’ve added the function below in App/bootstrap.php ini_set('session.cookie_domain',…