trait_shell
index.php
class.Toy.php
class.car.php
PHP Dependency Injection
<?php class Log() { $protected writer = false; function __construct($writer) { $this->write = $writer; } public function log($message) { if( ($message == "") || ($this->write == false) ) { return; } $message = date("Y-m-d H:i:s")." – ".$message."rn"; $this->writer->log($message); } } class fileWriter { public function log($message) { file_put_contents("./fileWriter.log", $message, FILE_APPEND); } } class databaseWriter { public function log($message) { $db->insert("log_table", array("message"), array($message) ); } } // do some stuff $oFileWriter = new fileWriter(); $oDatabaseWriter = new databaseWriter(); // log to…
Multiple Function Calls
Log Class
PHP opcache
; enable the opcache opcache.enable=1; ; set validate_timestamps to 1 to cause PHP to check if the file ; has been modified. ; This check will happen every revalidate_freq seconds. ; If a file is older than revalidate_freq seconds AND it has changed ; it will be removed from the cache and recompiled next time the ; page is accessed. opcache.validate_timestamps=1 opcache.revalidate_freq=600 ; set this to 0 to cause PHP to check the timestamps on each access. ; optionally, you…