Skip to content

Moving files to php5 folder keeping the old links #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Book/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ PHP 5
.. toctree::
:maxdepth: 2

introduction.rst
build_system.rst
php5/introduction.rst
php5/build_system.rst

* Creating PHP extensions

.. toctree::
:maxdepth: 2

zvals.rst
php5/zvals.rst

* Implementing functions

.. toctree::
:maxdepth: 2

hashtables.rst
classes_objects.rst
php5/hashtables.rst
php5/classes_objects.rst

PHP 7
-----
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ than this would cause an overflow (thus making the length negative).
The remaining three types will only be mentioned here quickly and discussed in greater detail in their own chapters:

Arrays use the ``IS_ARRAY`` type tag and are stored in the ``HashTable *ht`` member. How the ``HashTable`` structure
works will be discussed in the :doc:`/hashtables` chapter.
works will be discussed in the :doc:`/php5/hashtables` chapter.

Objects (``IS_OBJECT``) use the ``zend_object_value obj`` member, which consists of an "object handle", which is an
integer ID used to look up the actual data of the object, and a set of "object handlers", which define how the object
behaves. PHP's class and object system will be described in the :doc:`/classes_objects` chapter.
behaves. PHP's class and object system will be described in the :doc:`/php5/classes_objects` chapter.

Resources (``IS_RESOURCE``) are similar to objects in that they also store a unique ID that can be used to look up the
actual value. This ID is stored in the ``long lval`` member. Resources are covered in the Resources chapter (which
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion build_html.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sphinx-build -b html -d BookHTML/doctrees Book BookHTML/html
sphinx-build -b html -d BookHTML/doctrees Book BookHTML/html
php generate_php5_redirects.php
3 changes: 2 additions & 1 deletion build_release_html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ rm -rf BookHTML/html/*/
rm -f BookHTML/html/*.html
rm -f BookHTML/html/.buildinfo

sphinx-build -b html -d BookHTML/doctrees -a Book BookHTML/html
sphinx-build -b html -d BookHTML/doctrees -a Book BookHTML/html
php generate_php5_redirects.php
59 changes: 59 additions & 0 deletions generate_php5_redirects.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

// generates html redirect files so that urls do not break with the addition of the php5 folder

$files = [
'introduction.html',
'build_system.html',
'classes_objects.html',
'hashtables.html',
'introduction.html',
'zvals.html',
'build_system/building_extensions.html',
'build_system/building_php.html',
'classes_objects/custom_object_storage.html',
'classes_objects/implementing_typed_arrays.html',
'classes_objects/internal_structures_and_implementation.html',
'classes_objects/iterators.html',
'classes_objects/magic_interfaces_comparable.html',
'classes_objects/object_handlers.html',
'classes_objects/serialization.html',
'classes_objects/simple_classes.html',
'hashtables/array_api.html',
'hashtables/basic_structure.html',
'hashtables/hash_algorithm.html',
'hashtables/hashtable_api.html',
'zvals/basic_structure.html',
'zvals/casts_and_operations.html',
'zvals/memory_management.html',
];

$template = '<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=_URL_">

<script>
window.location.href = "_URL_"
</script>
</head>
<body>
<title>Page Redirection</title>

If you are not redirected automatically, follow <a href="_URL_">this link.</a>
</body>
</html>';

$basePath = __DIR__ . '/BookHTML/html/';
$baseURL = '/php5/';

foreach ($files as $file) {
$fileName = $basePath . $file;
if (!file_exists(dirname($fileName))) {
mkdir(dirname($fileName));
}

$content = str_replace('_URL_', $baseURL . $file, $template);
file_put_contents($fileName, $content);
}