sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
Yes, we sell some fabric, machines, notions, and do sewing machine service for many brands. My mom teaches some classes. I'm not there all the time, so if you'd like to meet, let me know.
-
I would agree with you, except that the router already exists, I'm just trying to modify it. Also, the symfony router is super heavy. The existing router may not be as configurable and awesome, but it's about a tenth of the code or less.
-
After preg_quote slashes regex characters, this code replaces the placeholders with real regex. Sure, performance is always a concern, but many eyes on the code could point out something that I didn't realize could be an issue.
-
In a project that I'm working on I can specify routing rules, which is somewhat similar to mod_rewrite but in PHP. It's currently set up to use full regular expressions, but it's kind of overkill. I'm trying to convert it to use routing rules similar to some of the php frameworks I've seen. The code I've written up below is working, and while it's unlikely that I would need anything more complex, I'm wondering if anyone would like to comment, offer suggestions, or offer criticisms. This little piece of code is just a part of a bigger routing class, but this is the code that I'm concerned with. Thanks. <?php $cfg['routes'] = [ 'cars/(:any)/(:any)/(:num).php' => 'cars/$3/$1/$2', 'default_route' => 'cars/index', 'trucks/parts?year=(:num)' => 'parts/trucks/$1', 'vans/articles(:any)' => 'articles$1' ]; $uris = [ 'cars/toyota/tercel/2014.php', # /cars/2014/toyota/tercel 'default_route', # /cars/index 'trucks/parts?year=2014', # /parts/trucks/2014 'vans/articles?p=42342' # /articles?p=42342 ]; $i = 0; foreach( $cfg['routes'] as $k => $v ) { $k = '|^' . preg_quote( $k ) . '$|uiD'; $k = str_replace( [ '\(\:any\)', '\(\:alnum\)', '\(\:num\)', '\(\:alpha\)', '\(\:segment\)' ], [ '(.+)', '([[:alnum:]]+)', '([[:digit:]]+)', '([[:alpha:]]+)', '([^/]*)' ], $k ); echo '<br />' . $uris[$i] . '<br />' . $k . '<br />'; if( @preg_match( $k, $uris[$i] ) ) { echo preg_replace( $k, $v, $uris[$i] ) . '<br /><br />'; } $i++; }
-
The best thing about Godaddy is their refund for unused service. It makes it easy to quit. They do suck. I once proved to them that their servers were modifiying my headers (basically dropping custom headers), and they said they wouldn't do anything about it. In their words, they don't do anything special for customers. Either you like it or leave. So I left. That was years ago. I'm sure the same philosophy exists today.
-
How to keep kids from tampering with Internet Explorer history on Win8
sKunKbad replied to sKunKbad's topic in Miscellaneous
We've tried to do all of the recommended usuals, especially keeping the computer right in the living room. At any given point in time he only has a number of seconds before one of us is walking around the corner, looking at him from across the room, etc. I know what you're all saying about a kids desire to defeat parental controls. I think he's still young enough that he's really not doing anything all that bad, but I know that many of the bad elements of the internet present themselves to you; you don't have to look for them. I'm mostly concerned with porn. I have a responsibility to at least try, so I will give it my best shot. I was able to find out how to use the group policy editor to keep him from deleting history ... until he figures out how to defeat it. -
How to keep kids from tampering with Internet Explorer history on Win8
sKunKbad replied to sKunKbad's topic in Miscellaneous
Thanks to everyone for replies. I have looked around quite a bit today, and I have found a program that looks pretty good. It's called Any Keylogger, from http://anykeylogger.net It is $29.00, and I want to read some reviews and try it out, but it has a lot of features. -
How to keep kids from tampering with Internet Explorer history on Win8
sKunKbad replied to sKunKbad's topic in Miscellaneous
I've been checking this out, but need to ask something. How do you keep your kids from having access to your chrome supervisor account? I created an account for my son, then closed the browser, but when re-opening the browser it never asked for login or to choose a user. -
Like many parents, I'm challenged with keeping my kids from browsing the evil parts of the internet. My son is 11 and my wife caught him deleting IE history the other day. The computer he uses is a Windows 8.1 laptop, and it is not Pro. How can i let him use internet explorer on his own user but keep him from tampering with any of the history ( or settings for that matter)? Is there a better solution? I found some internet history logging software online, but I didn't feel comfortable with the source, and fear it may contain viruses or other malware.
-
Well, I'm a self taught web dev / designer. I own a sewing machine business, which is just South of Old Town Temecula. I got into dev and design because of the business, but found that I enjoy the work, and have been making other people websites for approximately 7 or 8 years. I'm pretty much all PHP, MySQL, and JavaScript. I've dabbled with Python, Ruby, Visual Basic, C++, but have never really done anything with them. Besides my regular lineup of customers, I've started making free websites for Christian churches. So yes, I stay really busy!
-
What's wrong with my query? Works on sqlyog, but nowhere else.
sKunKbad replied to sKunKbad's topic in MySQL Help
Yes, that was it. Weird that SQLyog does it for me. Thanks! -
What's wrong with my query? Works on sqlyog, but nowhere else.
sKunKbad posted a topic in MySQL Help
I have a need to do a special sorting for a bunch of leads. The person who sees the leads (l.user) is looking at leads that are for a few different people (l.team_id). When I run my query in sqlyog, it gives me the results I am looking for, where the rank is used to sort. When I run my query through phpMyAdmin, php, or the MySQL command line, all of the ranks are NULL, so nothing gets sorted. All of these attempts are on the same database, on the same computer (Windows 7). Any ideas or help is appreciated. SELECT x.lead_id, x.rank, x.team_id, x.status FROM (SELECT l.lead_id, l.team_id, l.status, CASE WHEN @ps != l.team_id THEN @rownum := 0 WHEN @ps = l.team_id THEN @rownum := @rownum + 1 ELSE @rownum END AS rank, @ps := l.team_id FROM `system-leads` l WHERE (l.user = 189905706) AND l.status != "closed" LIMIT 100000000 OFFSET 0) `x` ORDER BY x.status ASC, x.rank ASC, x.lead_id ASC I wonder why it works in sqlyog and not the others, but I need it to work regardless of what client I am using. -
It's a small world after all ... What other programming languages or technologies are you experienced with? What is your strength?
-
I don't think you have to use a framework, but many times a framework is going to make something easier for you, or take care of security issues (or other issues) that you didn't realize were issues. I think you should drop CodeIgniter and use Symfony, Laravel, Yii, or almost anything else. CodeIgniter may not be officially dead, but its ways are not the ways of modern PHP development. You want to learn something that is worth your time, not something that is mocked and teach you the wrong way.
-
Specific Criticism of CodeIgniter as a PHP Framework in 2014
sKunKbad replied to sKunKbad's topic in Frameworks
Can you be specific regarding why you had never or would never consider using CI? How and why was that decision made? What kind of developer uses CI, and how is that different than you? Also, in what way do you think CI has done harm to the php landscape? I'm looking for specific facts regarding CI's deficiencies, problems, etc. Could it be that it's just popular to hate CI? You mentioned that CI may fill a need for some developers. Can you elaborate? -
I find that in most cases client-side and server-side form validation are beneficial. Client-side validation through JavaScript can provide instant feedback to the user, and prevent a frustrating user experience. Server-side form validation can quickly eliminate problems where input data is not in it's correct form, and give the user a chance to fix it based on error messages that you can show. For example, if the form expects an integer for a value, both client-side and server-side validation could let the user know there is an error because they input the letter A. This field could also be required, so if left empty, both validations would have let the user know. JavaScript can be disabled, so it should never be the only validation. It should just be used to enhance the user experience. Server-side validation cannot be disabled, so it's the essential validation for your form. The responses above do correctly state that security issues are based on the way you use the data, but when you restrict the incoming data based on a tight set of rules and filters, the data can actually be expected to function correctly for its intended use. You can't be too safe. You want to validate the incoming data, AND use it in a safe way.
-
As a long time CodeIgniter user, I made the decision to move away from CodeIgniter a while back. I still maintain, and in some cases develop new features for websites that I made using CodeIgniter. Still somewhat active in the CodeIgniter forum, I have seen a recent question, "How do we get CodeIgniter back to the PHP framework of choice?". I have offered my own criticism of the framework, but the thread is located on the CodeIgniter forum, so many just protect their beloved CI, not willing to accept that it is in great need of change. I would appreciate if phpfreaks members would be critical, and hopefully specific in regards to CodeIgniter's problems. I intend to link to this thread, with the hopes that your opinions will help future development of CodeIgniter. Thank you.
-
https://knpuniversity.com/ has REST and Symfony tutorials, but I think their REST tutorial uses Silex.
-
I like PDO because of the named placeholders, but I use Doctrine DBAL, which has some bonuses over plain PDO. DBAL's documation is nice. Check out DBAL's introduction: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/introduction.html
-
Is it just me, or is composer / packagist.org super slow
sKunKbad replied to sKunKbad's topic in Miscellaneous
Hey, that's a great idea. Of course you knew that ... -
Making a program to automatically install PHP frameworks
sKunKbad replied to CrimpJiggler's topic in Miscellaneous
What Ch0cu3r said. And if you're framework of choice isn't on packagist.org, you might simply use Git to clone the framework's repo. -
Are you new to programming in general, or just PHP? I ask because jumping into frameworks and OOP is probably way more than you can handle if you don't have any programming experience at all. Even if you think you can handle working with CodeIgniter, which is one of the easiest frameworks to use, that doesn't mean you should. I say this because I've used CodeIgniter for years, and can't tell you how many people ask questions on their forums about simple PHP problems. They were misunderstanding framework usage, thinking that the framework eliminated the need for knowing PHP. It's my opinion that you should get some procedural PHP skills before jumping on the framework bandwagon. I used PHP for more than 3 years before I even started in with OOP. You're not likely to create anything awesome if you don't know PHP and try to use a PHP framework. Also, just something to consider, is the amount of crap code produced by CodeIgniter users, who will gladly give it to you for free. CodeIgniter used to have a Wiki, but since they dropped the Wiki from their website, you will now find CodeIgniter "solutions" all over the internet. Remember, just because they exist doesn't mean they are safe to use, or that they won't have serious limitations or issues. Last but not least, CodeIgniter's newer 3.X branch has a user license that may not work in many business environments. Be wary and read the license!
-
I've got my own proprietary framework. I call it Brain. It uses composer, and installation is done with a single composer file, which is handy. Here's an example: { "name": "skunkbad/brain-test", "description": "My Awesome App", "license": "proprietary", "minimum-stability": "dev", "repositories": [ { "type": "hg", "url": "ssh://hg@bitbucket.org/skunkbad/brain" } ], "require": { "skunkbad/brain": "default" }, "scripts": { "post-install-cmd": "Brain\\Statics\\BrainInstallScript::run" } } Brain has it's own dependencies, which aren't all really dependencies, but I've added them all to its composer.json file so I get everything I want for a new project. Here is it's composer.json: { "name": "skunkbad/brain", "version": "1.0.0", "type": "framework", "license": "Proprietary", "authors": [ { "name": "Robert B Gottier", "email": "xXxXxXxXx@gmail.com", "homepage": "http://brianswebdesign.com", "role": "Developer" } ], "require": { "pimple/pimple" : "v2.0.0", "swiftmailer/swiftmailer": "v5.2.0", "dompdf/dompdf" : "0.6.1", "phpseclib/phpseclib" : "0.3.6", "stripe/stripe-php" : "v1.15.0", "firephp/firephp-core" : "dev-master", "doctrine/dbal" : "v2.4.2" }, "autoload": { "psr-4": { "Brain\\": "/", "App\\": "../../../App/" }, "classmap": [ "Statics/" ] } } In Windows terminal, I can run composer install or composer install --prefer-dist, and it seems that especially when the doctrine packages are being downloaded or cloned (whatever it does), its super slow. Some of them hang for so long that occasionally the terminal will give me a message indicating a particular package timed out (5 mins). So I was wondering if this is just the norm. Feels like I'm on dial-up, but my internet connection is Verizon FiOS (fiber optic). Here is an example of the time-out message I get from Composer: I timed my install, and composer/common actually hung for about 7 mins. Total time was 9.5 mins.