Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Reads entire file into a string
<?php file_get_contents( string $filename, bool $use_include_path = false, ?resource $context = null, int $offset = 0, ?int $length = null): string|false
<?php $lineNum = $info['line'];
$startLine = max($lineNum - $num, 1);
$endLine = $lineNum + $num;
$code = file_get_contents($info['file']);
if ($output instanceof ShellOutput) {
$output->startPaging();
<?php $tmp = __DIR__ . '/_runtime_components.json';
if (file_exists($tmp)) {
$components = json_decode(file_get_contents($tmp));
foreach ($components as $name => $class) {
if (is_numeric($name)) {
<?php $stubName = $inline ? 'livewire.inline.stub' : 'livewire.stub';
if (File::exists($stubPath = base_path($this->stubDirectory.$stubName))) {
$template = file_get_contents($stubPath);
} else {
$template = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.$stubName);
}
<?php if (File::exists($stubPath = base_path($this->stubDirectory.$stubName))) {
$template = file_get_contents($stubPath);
} else {
$template = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.$stubName);
}
if ($inline) {
<?php return preg_replace(
'/\[quote\]/',
$this->wisdomOfTheTao(),
file_get_contents($stubPath)
);
}
<?php $stubName = $testType === 'pest' ? 'livewire.pest.stub' : 'livewire.test.stub';
if(File::exists($stubPath = base_path($this->stubDirectory.$stubName))) {
$template = file_get_contents($stubPath);
} else {
$template = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.$stubName);
}
<?php if(File::exists($stubPath = base_path($this->stubDirectory.$stubName))) {
$template = file_get_contents($stubPath);
} else {
$template = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.$stubName);
}
return preg_replace(
<?php public function classContents($inline = false)
{
$originalFile = file_get_contents($this->existingParser->classPath());
$escapedClassNamespace = preg_replace('/\\\/', '\\\\\\', $this->existingParser->classNamespace());
<?php public function testContents($testType = 'phpunit')
{
$file_content = file_get_contents($this->existingParser->testPath());
$escapedTestNamespace = preg_replace('/\\\/', '\\\\\\', $this->existingParser->testNamespace());
$escapedClassWithNamespace = preg_replace('/\\\/', '\\\\\\', $this->existingParser->classNamespace() . '\\' . $this->existingParser->className());
<?php file_put_contents(
$stubsPath.'/livewire.stub',
file_get_contents(__DIR__.'/livewire.stub')
);
file_put_contents(
<?php file_put_contents(
$stubsPath.'/livewire.inline.stub',
file_get_contents(__DIR__.'/livewire.inline.stub')
);
file_put_contents(
<?php file_put_contents(
$stubsPath.'/livewire.view.stub',
file_get_contents(__DIR__.'/livewire.view.stub')
);
file_put_contents(
<?php file_put_contents(
$stubsPath.'/livewire.test.stub',
file_get_contents(__DIR__.'/livewire.test.stub')
);
file_put_contents(
<?php file_put_contents(
$stubsPath.'/livewire.pest.stub',
file_get_contents(__DIR__.'/livewire.pest.stub')
);
file_put_contents(
<?php file_put_contents(
$stubsPath.'/livewire.form.stub',
file_get_contents(__DIR__.'/livewire.form.stub')
);
file_put_contents(