This video shows how to get the lines of code in a PHP application by using PHPLoc from the command line or using Docker. PHPLoc is a command line application to generate a small but useful report. Adam Culp will show how to use it from a Docker Container using a Docker Image he created. PHPLoc ...
Xdebug Update: March 2019
London, UK
Tuesday, April 9th 2019, 14:15 BST
This is the first of the monthly update reports in what happened with Xdebug development in this past month. In these reports I will outline what I've been working on t...
Matt Stauffer announced that his book Laravel Up and Running Second Edition is available in ebook format, and the print book should ship some time in mid-April 2019.
Visit Laravel News for the full post.
The post Laravel Up and Ru...
Twitter used this to tell HTTP clients that they were being rate limited. Rate
limiting means putting restrictions on the total number of requests a client
may do within a time period.
For Twitter it was useful enough to extend the protocol with a new HTTP status code.
However, adding your own HTTP status codes is a bad idea and should generally be
avoided.
In many cases it’s possible to express your error condition through one of the
exiting status codes. Error statuses that are more unique to your application
should simply be communicated via a response body. (for example the standard
application/problem+json response).
So when is a new HTTP status code useful? The general idea is that adding a
new code to the list is useful if it’s possible for a generic HTTP client
to do something with the response.
The idea of having a standard HTTP code for rate limiting was useful enough to
be turned into a real HTTP status, So a few years later, we got the
429 Too Many Requests status code, which Twitter ended up adopting too.
This is the first of the monthly update reports in what happened with Xdebug development in this past month. In these reports I will outline what I've been working on the month that has passed. It will be published on every second Tuesday of each month. Patreon supporters will get it earlier, on the first of each month. You can become a patron here.
In February, I worked on the following things:
CI
Xdebug needs testing on many PHP versions, from PHP 7.0.0 to PHP 7.3.3, and the tip of the PHP 7.0 to 7.4 and master branches. Each patch version can introduce changes, and so they all need to be tested against. There are also two different configuration axis: thread-safe vs. non-thread-safe, and 32-bit vs 64-bit. There are currently 37 versions, and with all 4 combinations, that makes 148 configurations to test. If I would test this with Travis CI this would take at least an hour, and with Appveyor it would take at least 16 hours. This is clearly not something that I would like to wait on.
So instead I set up a local CI system, where after each commit I can kick off a script that recompiles and tests all of the configurations. I test the following three variants for each PHP version: 64-bit and non-thread-safe (that's the normal one most people use), 64-bit with thread-safe, and 32-bit with non-thread-safe. My local machine can run 24 tasks in parallel, and the full run of recompiling and testing takes less than 5 minutes.
The results are imported in a MongoDB database that I run on their Atlas hosted server, and the results are read and published by the Xdebug website, where you can see the result of the latest 8 runs.
I still need to add the with-OPcache/without-OPcache access; right now, I only test with OPcache present and loaded. I would also like to add configurations of daily versions of the latest PHP-7.4 and master branches to be able to get PHP API changes, and functional changes before they start breaking PHP.
Bugs
I created stablexdebug_2_7 branch so that I can work on both bug fixes (in xdebug_2_7) and features (in master). There is currently a persistent bug that I discovered while analysing #1646: Excessive error messages for broken pipes. I noticed that although my tests would check for this happening, it would never actually make sure that there were no messages sent to stderr. When enabling this, I encountered issues in the step-debugger tests where I wouldn't correctly detach the debugging session.
These tests are now fixed, but there is now one that produces an elusive crash bug that I haven't managed to track down now.
The last thing I wanted to draw your attention to is a new podcast that I started: PHP Internals News. This is a weekly-ish 15 minutes-ish long podcast, where I talk with PHP internals developers about a new RFC, implementations, and upcoming features. It is available on Spotify and iTunes, and an RSS Feed.
So far I have spoken
Truncated by Planet PHP, read more at the original (another 612 bytes)
MessagePack serialization for traces sent to the Agent with a new function dd_trace_serialize_msgpack() #378
Changed
Request init hook module blacklist now avoids miss matching partial matches #372
Add 10MB cap to payloads sent to the Agent #388
Added an getTracesAsArray() method to DDTrace/Contracts/Tracer which returns an array of spans (which are also encoded as an array.) To encode an instance of DDTraceContractsSpan as an array, use DDTrace/Encoders/SpanEncoder::encode($span) #378
DDTrace/Transport::send() now takes an instance of DDTrace/Contracts/Tracer instead of an array #378
DDTrace/Encoder::encodeTraces() now takes an instance of DDTrace/Contracts/Tracer instead of an array #378
The default encoder is now DDTrace/Encoders/MessagePack. You can still use the JSON encoder by setting the environment variable DD_TRACE_ENCODER=json. It is generally not recommended to use the JSON encoder as parsing JSON payloads at the Agent level is more CPU & memory intensive.
MONDAY, Oct. 22, 2018 (HealthDay News) — The U.S. Drug and Food Administration has repeatedly warned manufacturers that many dietary supplements contain dangerous, experimental stimulants. But according to a new report, 75 percent of supplements tested still contain the compounds.
“Consumers turn to supplements for safe, natural ways to increase energy, improve workouts or lose weight,” said study author Dr. Pieter Cohen, an associate professor with Harvard Medical School. “[But] what most consumers don’t know is that supplements can be sold as if they give you energy, help you lose weight or just about anything, as long as the supplement does not claim to cure or treat disease.”
His team’s findings centered on four unapproved stimulants: DMAA, DMBA, BMPEA and oxilofrine.
The four have become replacements for the stimulant ephedra, which the FDA banned from supplements in 2004 following reports that it raised the risk for heart attack, stroke and death.
Between 2013 and 2016, the FDA found that 12 different supplement brands contained one or more of the four unapproved stimulants. But despite public notice warnings from the agency, three-quarters of the supplements still contained at least one prohibited stimulant in 2017. And half contained two or more.
The finding raises fresh concerns about supplement safety, and comes on the heels of another troubling analysis published just last week by the California Department of Public Health’s Food and Drug Branch.
That investigation revealed that the FDA had issued more than 700 warnings over the last decade about potentially hazardous ingredients found in supplements promoted as sexual, weight-loss and muscle growth aids.
But because the FDA classifies dietary supplements as a food — rather than as drugs — supplement manufacturers do not have to prove a supplement is safe or effective before selling it to the public.
If, however, the FDA ultimately determines that a supplement already on the market is potentially hazardous, it can recall the product or issue a “public notice” concerning problematic ingredients.
In a letter published online Oct. 22 in the journal JAMA Internal Medicine, Cohen and his colleagues point to an earlier study that suggests that FDA recalls, for one, are largely ineffective.
Continued
The latest investigation focused on the effectiveness of public notice warnings, and found equally poor results.
“The FDA seems to imagine that if they simply request that firms remove an experimental stimulant from commerce, the stimulant will be removed,” Cohen said. “Clearly this is wishful thinking on the part of the FDA.”
Cohen noted that he and his associates conducted two analyses of 12 supplements previously issued public notices for unapproved ingredients.
The first analysis took place in 2014. At that time, all 12 supplements contained at least one of the four prohibited stimulants.
The second analysis took place in 2017. At that point, nine of the 12 brands contained at least one prohibited supplement and six contained two.
The team also pointed out that although DMBA had not been found in any of the 12 supplements in 2014, it was found in a third of the supplements in 2017, two years after the FDA issued a public notice raising concern about the ingredient.
“Until the law is reformed and the FDA aggressively enforces the law, these potentially dangerous ingredients will likely remain in supplements,” said Cohen.
Dr. Mitchell Katz is president and CEO of NYC Health and Hospitals in New York City, and author of an accompanying editorial. He suggested that the upshot is that the FDA is hamstrung in what it can do.
“The FDA is not allowed by federal law to investigate a product before it is marketed,” Katz noted. “Therefore, all that the FDA can do under current law is respond to complaints and issue guidelines of what can and cannot be in supplements.”
The bottom line, said Katz, is that “people should know that the supplements they are taking are not tested [and] may contain substances that are not on the label.”
‘);
} else {
// If we match both our test Topic Ids and Buisness Ref we want to place the ad in the middle of page 1
if($.inArray(window.s_topic, moveAdTopicIds) -1 $.inArray(window.s_business_reference, moveAdBuisRef) -1){
// The logic below reads count all nodes in page 1. Exclude the footer,ol,ul and table elements. Use the varible
// moveAdAfter to know which node to place the Ad container after.
window.placeAd = function(pn) {
var nodeTags = [‘p’, ‘h3′,’aside’, ‘ul’],
nodes,
target;
$(”).insertAfter(target);
}
// Currently passing in 1 to move the Ad in to page 1
window.placeAd(1);
} else {
// This is the default location on the bottom of page 1
$(‘.article-page:nth-child(1)’).append(”);
}
}
})();
$(function(){
// Create a new conatiner where we will make our lazy load Ad call if the reach the footer section of the article
$(‘.main-container-3’).prepend(”);
});
Folks, wake-up and smell the rip-off along with your coffee. Over-the-counter weight loss products that make get-thin-quick promises do not work. The greedy diet industry generates more than $40 billion a year. If any fad diet worked the entire world would know it.
Include weight loss patches in the list of snake oils. I shout, “phony baloney.”
Weight loss patches are considered dietary supplements and do not undergo testing by the Food and Drug Administration.
“In 2004, the Federal Trade Commission charged a number of weight-loss patch manufacturers with fraud and false advertising as a result of an investigation initiated by complaints from customers. The claims included that the patches would cause permanent weight loss, melt away fat and enable users to lose up to three pounds per week. Some of the charges were also brought because some companies claimed they had back-up from the FDA or that the ingredients used in the patch had been approved by the FDA,” according to an article on the Live Strong website. www.livestrong.com/.
Furthermore, there is no evidence that these patches work. Any studies claimed by the product manufacturers are bogus as their claims do not meet standards for scientific studies. You might as well flush your dollars down the toilet. The only thing you’ll lose is your cash.
Diet patches stick on your skin like a Band-Aid. And many have flowery designs. Weigh management skin patches are fake. Tummy patches to reduce weight gain and fat mass are false. Weight-loss patches might seem like a dieter’s dream, but they are a nightmare. Why? Because the company is taking your coins—and patches do not work. Buyers are making owners happy scammers.
And the latest news is that scientists from the Nanyang Technological University (NTU) in Singapore have developed a new skin patch with micro-needles that burn a significant amount of tummy fat. Is this just another snake oil gimmick? The patch has been tested in mice and not humans. Well, let’s just put these skinny mice in bikinis and plaster their photos on glamour magazines. And lets throw our common sense down the sewer.
“But experts say no effective weight loss drugs have been designed to be delivered through the skin via patches. Most of the time, these patches contain the same ineffective herbs found in dietary supplements or teas,” according to an article on WebMD. www.webmd.com/.
Ingredients
Ingredients used in weight-loss patches may include a stimulant such as guarana or the appetite suppressant hoodia, among others. And if these patches really worked the world would be abuzz with the news!
Garcinia cambogia is no miracle weight-loss ingredient either, according to Consumer Reports. “In 2009 the Food and Drug Administration warned consumers about Hydroxycut, a product line containing garcinia cambogia and several other ingredients, based on serious reports of health problems, including jaundice, elevated liver enzymes, liver damage requiring a transplant, and one death from liver failure.” www.consumerreports.org/ http://www.consumerreports.org/ . Consumers, buy-at-your-own risk.
The Takeaway
Don’t be bamboozled by slippery sales pitches, counterfeit claims, and glittery gimmicks. Step away from your credit card when you encounter a weight loss patch advertisement. Save your money to spend on a consultation with a dietician, healthy foods, and a gym membership.
Melissa Martin, Ph.D, is an author, columnist, educator, and therapist. She resides in
Southern Ohio. www.melissamartinchildrensauthor.com http://www.melissamartinchildrensauthor.com/ . Contact her at [email protected] mailto:[email protected] .
A company that sold “ineffective” fat-fighting herbal supplements is facing a $12.8m (£9.6m) fine for allegedly buying fake reviews on Amazon.
The fine is part of a settlement deal Cure Encapsulations has reached with the US Federal Trade Commission (FTC).
Cure had paid a now defunct website for positive reviews to push claims its pills helped weight loss, said the FTC.
The company has also been told to stop making “false and unsubstantiated” claims about one supplement.
‘Liver injury’
Cure Encapsulations makes pills it claims can be used to lose weight, using extracts made from the rind of a tropical fruit called Garcinia cambogia – a variety of tamarind.
But US research suggests such supplements have caused “acute liver injury” in some people who took them regularly. And US government advice suggests they have “little or no effect” on weight loss.
The FTC said Cure had spent significant sums to get positive reviews on Amazon that had been “fabricated” to seem as if they had come from actual customers.
And it had specified they must:
claim the pills “block” fat and cause “significant weight loss”
result in the supplement being given a five-star rating, to bump up sales
The settlement demands Cure Encapsulations contacts former customers, passing on official doubts about the efficacy of its products.
It has also been told to seek “competent and reliable” scientific evidence for any health-boosting claims it makes in the future for Garcinia-based supplements.
A US judge must now rule on whether the settlement is an appropriate remedy for Cure’s conduct.
The proportion of the $12.8m fine the company would actually end up paying depended on how much cash it had at its disposal, the FTC said.
Review police
“People rely on reviews when they’re shopping online,” said Andrew Smith, head of the FTC’s consumer protection division, in a statement.
“When a company buys fake reviews to inflate its Amazon ratings, it hurts both shoppers and companies that play by the rules.”
The case is the first FTC settlement deal to centre on fraudulent Amazon reviews.
In a statement, Amazon said it “welcomed” the FTC’s action and invested “significant resources” in protecting reviews.
“Even one inauthentic review is one too many,” it said.
Cure Encapsulations has yet to respond to a BBC News request for comment.