I have a stylish sheet for this: #head-nav .brand img { display: none; }
I complained about but apparently the opinion of the PHP website maintainers is that it's cool or something, and in no way could it possibly be distracting while you're maybe, I don't know, trying to read the manual
@Darick best way whould be stripping down your problem to a simple example and ask a question on SO. Not sure how many people in this channel use mockery at all.
You testing the mocked object, not actual one. Sometimes this is needed (abstract classes) but mostly it is a code smell. I you case it show that the constructor of the class contains some logic it should not.
This is not a testing but more a programming question, I would inject the model or a modelbuilder into the provider. In the test I would inject a mock of the model/modelbuilder and use it. But the tested class itself would not be modified or mocked.
@PeeHaa I choose not to go on my own.. Just so I would still have somehwat of a 'social' life after work hours (which also are way to long sometimes...)
Please How to add multiple values of an associative array to the same key ? I have an array $array = array(':hbd:' => 'happy_birthday.mp4', ':wow:' => 'clapping_hands.mp4',); and i would like to link the keys :hbd: to an images url also. Is there a way of adding two values to the same key in an array and latter have something like $array[':hbd:']['happy_birthday.mp4'] that will give me the segond value ?
@FerdineFaithfull Each array key can only have 1 value, but that value could be an array holding multiple values. eg: $array=(':hbd:' => array($value1, $value2)); print $array[':hbd:'][0];
@AllenJB Good. Now finaly, please can i retreive the informations using foreach ($array as $code => $value) ? If yes, please can you give me an example based on that ?
@ThW wow
@ThW Now please can i retreive the information using foreach ($array as $code => $value) ? If yes, please can you give me an example based on what you gave me that ?
@FerdineFaithfull @ThW 's solution should work for you - you may need to replace the short array syntax (square brackets) with "old style" array syntax.
@AllenJB yOUR solution gives me this the simplest result : happy_birthday.mp4 and my_image.jpg While @Thw solution gives me array(2) { ["video"]=> string(18) "happy_birthday.mp4" ["image"]=> string(18) "happy_birthday.png" } string(18) "happy_birthday.png" array(2) { ["video"]=> string(18) "clapping_hands.mp4" ["image"]=> string(18) "clapping_hands.png" } string(18) "clapping_hands.png"
@AllenJB so if i can have a foreach with your solution that will be great otherwise if i can correct the error in dreamweaver with @Thw solution that will be great
@FerdineFaithfull The only difference between the 2 is that I used (implicit) numeric indexes while he used associative (string) indexes on the 2nd array. You can use foreach in the same way on both.
@FerdineFaithfull I highly recommend you read the manual sections on arrays and foreach. They can explain things much better than I can.
Hello for SEO experts : i know that it is good to make ur site have a friendly URL for example mywebsite.com/news/ SO why youtube have an old url structure that has parameters look this is url of youtube : https://www.youtube.com/watch?v=wiNV12JP0jg
It wasn't working in 5.6.0RC3 I believe ... so it was added quite late in the game.
It would either say "Parse error: syntax error, unexpected '[', expecting ',' or ';'" or "Fatal error: Arrays are not allowed in constants at run-time"
Is there any way to "use" the \ namespace while in a namespace? (refactoring.. )
Prefixing a few thousand stdClasses, datetimes and other objects with a \ is a bit of a hassle at this point. But I want to move the classes themselves into a application\controllers namespace while keeping the currently used classes in \ for the time being.
thing is.. the entire environment is without namespaces atm.. mostly using the zend naming convetion for class names.
this beast is slowly being moved from some crappy old php4-style-html+php+everything-in-a-file junk code.. to something more OOP.
been slowly moving that forward for quite some time.. I have introduced controllers for parts of the code.. we oop'ed a heap of classes.. but now slowly i want to add more structure
So i'm trying to move the controllers in an application/controllers namespace, but those controllers call tons of classes that live in the root namespace
which would mean i'd have to "\" every single instance.. which is incredibly risky.. since missing even one could cause some serious havoc
namespace application\controllers;
use \;
or something would be awesome.. but thats not gonna happen..
@DamienOvereem That sounds like a problem that can be solved by using a static code analyzer. PHPstorm comes with one that will scan your code and tell you which classes can't be found.
@DamienOvereem I wouldn't recommend refactoring like that. Instead rewrite the application part by part (If a route matches, execute new code. If not, go to old code).
I wish i could actually use mocking >< The absolute lack of dependency injection in my code makes mocking pointless.. Only basic tests for me at this point.
I mocked the class Weather and expected to receive a createRecordSet, how does it work? since i did not pass any query, filter, fetch in my mocked class?
shall anybody suggest me over below explain statement
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE m ALL PRIMARY,mem_id,mem_id_2,index_email 15835 Using where; Using temporary; Using filesort 1 SIMPLE n index mem_id,frd_id,mem_id_3,mem_id_2 mem_id_3 16 13269 Using where; Using index; Using join buffer (Block Nested Loop)
I think he may be well-served to provide some context: What is checking these 'roles'? Is this running within a framework? Which framework? Per @Jack's comment (21927512), what you're trying to do in the first place may not be a good idea.
However, if I expand my issue with "It displays Hello World, but all output after it continues to output onto the same line", then EVERYONE in this room would be able to identify the problem.
hey guys, I'm trying to explicitly log to apache, but it won't for some reason. I've tried error_log("HELLOOOOOOOOOOOO"); with no result, the file I'm reading is at /var/log/apache2/error.log
; Log errors to specified file. PHP's default behavior is to leave this value ; empty. ; http://php.net/error-log ; Example: error_log = php_errors.log ; Log errors to syslog (Event Log on Windows). error_log = syslog
Is there a way to set an environment variable that is of the type boolean so var_dump(getenv('SOME_BOOLEAN_ENV')); will show that it is boolean? If not, is there a recommended way to go about using flags without boolean?
Meh, he writes JavaScript, which is a dementor. A massive, evil, soul-sucking monster that you don't want to get into. Use JavaScript and you'll quickly lose the will to live; soon after being left a soulless husk.
==8305== Invalid read of size 8
==8305== at 0x7247322: zend_jmp_optimization (block_pass.c:1330)
==8305== by 0x724AA43: zend_block_optimization (block_pass.c:2075)
==8305== by 0x725385F: zend_optimize (pass5.c:2)
==8305== by 0x7253B0D: zend_accel_optimize (zend_optimizer.c:586)
==8305== by 0x7253CAD: zend_accel_script_optimize (zend_optimizer.c:633)
==8305== by 0x722BAEA: cache_script_in_shared_memory (ZendAccelerator.c:1145)
==8305== by 0x722CEA2: compile_and_cache_file (ZendAccelerator.c:1478)
I get that opcache can't detect end of a basic block, but dunno why ... if anyone could suggest another way to do it ... or put me out of my misery in any other way, that'd be great ...
off-topic When you RDP into a Win 7 box, the mic devices are disabled; is there any way to enable them during an RDP session? I'm trying to stream a/v, but since the mic is disabled (unrecognized) altogether, I can't select it as a device to stream from
@MjrKusanagi those link contained both bad SQL and bad PHP .. and they are fucking confusing for a newbie. Teaching a newbie 3 different ways is a horrible idea.